From taj at www.linux.org.uk Fri Jun 3 08:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 08:55:47 2005 Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Fri Jun 3 16:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 16:56:10 2005 Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Fri Jun 3 08:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:19 2005 Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Fri Jun 3 16:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:19 2005 Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi@qbang.org From jasmine at electronpusher.org Fri Jun 3 17:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri Jun 3 18:03:23 2005 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 18:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri Jun 3 18:03:24 2005 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 18:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri Jun 3 18:04:30 2005 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From taj at www.linux.org.uk Fri Jun 3 08:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:42 2005 Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Fri Jun 3 16:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:42 2005 Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi@qbang.org From jasmine at electronpusher.org Fri Jun 3 17:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri Jun 3 18:09:42 2005 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 18:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri Jun 3 18:09:42 2005 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 18:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri Jun 3 18:09:42 2005 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From jon.nall at gmail.com Mon Jun 6 16:13:58 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon Jun 6 16:13:01 2005 Subject: [Rxtx] StackOverflowError Message-ID: I have a fairly small application that is communicating to a microcontroller programmer at 115.2k. I have a test where I try and dump the memory of the microcontroller (whose size is 8k and change). Things are going smoothly and the data looks good. Then after reading out ~6.5k of data, I get a StackOverflowError. The stack trace looks like: CommInterface.serialEvent(): 324 // this is my code RXTXPort.sendEvent(): 732 RXTXPort.eventLoop() [Native] MonitorThread.run(): 1531 I am running on windows and using rxtx-2.1-CVS-20050120. When I increased the stack size to 512k, I could read the entire chip without issue. But that doesn't seem like the right thing to do without root causing what's happening. My code doesn't include any recursion and the stack trace looks terribly short, so I'm a bit confused as to why I'm getting a StackOverflowError. CommInterface.serialEvent() does little more than grab the available bytes, enter a synchronized block, stick them in a common data area for the main thread to use and leave the synchronization block. I guess my question is: are there any known issues with the default stack size when using the latest rxtx on windows? thanks, nall. From taj at www.linux.org.uk Mon Jun 6 16:27:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon Jun 6 16:25:40 2005 Subject: [Rxtx] StackOverflowError In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > I have a fairly small application that is communicating to a > microcontroller programmer at 115.2k. I have a test where I try and > dump the memory of the microcontroller (whose size is 8k and change). > Things are going smoothly and the data looks good. Then after reading > out ~6.5k of data, I get a StackOverflowError. The stack trace looks > like: > > CommInterface.serialEvent(): 324 // this is my code > RXTXPort.sendEvent(): 732 > RXTXPort.eventLoop() [Native] > MonitorThread.run(): 1531 > > I am running on windows and using rxtx-2.1-CVS-20050120. When I > increased the stack size to 512k, I could read the entire chip without > issue. But that doesn't seem like the right thing to do without root > causing what's happening. My code doesn't include any recursion and > the stack trace looks terribly short, so I'm a bit confused as to why > I'm getting a StackOverflowError. > > CommInterface.serialEvent() does little more than grab the available > bytes, enter a synchronized block, stick them in a common data area > for the main thread to use and leave the synchronization block. > > I guess my question is: are there any known issues with the default > stack size when using the latest rxtx on windows? > This is the first I've heard of the problem. It is strange as you mention lookin at the stack trace. That cant be taking up too much space. If you just toss the data instead of trying to put it in your work area, does it persist? -- Trent Jarvi tjarvi@qbang.org From lengyel at gmail.com Mon Jun 6 17:09:39 2005 From: lengyel at gmail.com (FL) Date: Mon Jun 6 17:09:27 2005 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on which the jdk1.5.0_03 is installed. I found that the INSTALL documentation seems to be in error. It states that javacomm20-x86.tar.Z (the Java Communications API for Solaris/x86) must be used, in fact this choice led to the following test with theBlackBox sample program in the commapi: root@creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG BlackBox -p /dev/ttyS0 Port /dev/ttyS0 not found! No serial ports found! Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to cause Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to the Eclipse stable build version 3.1M7 to avoid this. However, I found that using the Solaris/Sparc version of commapi worked on my system. I have documented this on: http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050606/b28fb9a7/attachment.html From taj at www.linux.org.uk Mon Jun 6 17:30:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon Jun 6 17:28:32 2005 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, FL wrote: > I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on > which the jdk1.5.0_03 is installed. I found that the INSTALL documentation > seems to be in error. It states that javacomm20-x86.tar.Z (the Java > Communications API for Solaris/x86) must be used, in fact this choice led to > the following test with theBlackBox sample program in the commapi: > > root@creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG > BlackBox -p /dev/ttyS0 > Port /dev/ttyS0 not found! > No serial ports found! > > Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to > cause > Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to > the Eclipse stable build version 3.1M7 to avoid this. > > However, I found that using the Solaris/Sparc version of commapi > worked on my system. > > I have documented this on: > > http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 > Thanks FL. I'll change the documentation to point to the SPARC comm.jar. In the past, any Solaris was good enough, we tried to avoid the w32 comm.jar because it made native calls rxtx would never implement on any OS as they are not platform neutral. I'll withold comments about Sun's comm.jar being different on various CPUs within even the same OS. RXTX 2.1 does not need to do that even acrossed OSs for instance. -- Trent Jarvi tjarvi@qbang.org From jon.nall at gmail.com Mon Jun 6 17:35:43 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon Jun 6 17:34:44 2005 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API Message-ID: It seems that Sun's javax.comm site does not include JavaDoc'ed API and the RxTx site has the API, but no real documentation. Is there some site that i'm just missing in my google searches? I'm looking for a copy of the javax.comm API which is documented. Thanks, nall. From taj at www.linux.org.uk Mon Jun 6 17:44:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon Jun 6 17:42:12 2005 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > It seems that Sun's javax.comm site does not include JavaDoc'ed API > and the RxTx site has the API, but no real documentation. Is there > some site that i'm just missing in my google searches? I'm looking for > a copy of the javax.comm API which is documented. > > Thanks, > nall. Sun's version is with their binary downloads. RXTX tries to match that so I never bothered with more complete JavaDocs. Whatever Sun documents is what we try to do. -- Trent Jarvi tjarvi@qbang.org From dacker at nomadio.net Mon Jun 6 19:13:44 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon Jun 6 19:12:49 2005 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: Message-ID: <20050606181245.528C929D56F@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces@mail.electronpusher.org > [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of Trent Jarvi > Sent: Monday, June 06, 2005 12:44 PM > To: Jon Nall; Java RXTX discussion > Subject: Re: [Rxtx] Where can I find JavaDoc on the javax.comm API > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > It seems that Sun's javax.comm site does not include JavaDoc'ed API > > and the RxTx site has the API, but no real documentation. Is there > > some site that i'm just missing in my google searches? I'm > looking for > > a copy of the javax.comm API which is documented. > > > > Thanks, > > nall. > > Sun's version is with their binary downloads. RXTX tries to > match that so I never bothered with more complete JavaDocs. > Whatever Sun documents is what we try to do. > > -- > Trent Jarvi > tjarvi@qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Try http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht ml -Ack From gadelavega at yahoo.com.ar Mon Jun 6 19:58:09 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Mon Jun 6 19:57:11 2005 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606181245.528C929D56F@mail.electronpusher.org> Message-ID: <20050606185809.57069.qmail@web14603.mail.yahoo.com> --- "David S. Acker" escribi?: > > -----Original Message----- > > From: rxtx-bounces@mail.electronpusher.org > > [mailto:rxtx-bounces@mail.electronpusher.org] On > Behalf Of Trent Jarvi > > Sent: Monday, June 06, 2005 12:44 PM > > To: Jon Nall; Java RXTX discussion > > Subject: Re: [Rxtx] Where can I find JavaDoc on > the javax.comm API > > > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > > > It seems that Sun's javax.comm site does not > include JavaDoc'ed API > > > and the RxTx site has the API, but no real > documentation. Is there > > > some site that i'm just missing in my google > searches? I'm > > looking for > > > a copy of the javax.comm API which is > documented. > > > > > > Thanks, > > > nall. > > > > Sun's version is with their binary downloads. > RXTX tries to > > match that so I never bothered with more complete > JavaDocs. > > Whatever Sun documents is what we try to do. > > > > -- > > Trent Jarvi > > tjarvi@qbang.org > > _______________________________________________ > > Rxtx mailing list > > Rxtx@mail.electronpusher.org > > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > Try > http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > ml > -Ack > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > I'm prety sure it was there... but not anymore. Gonzalo A. de la Vega, BI ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From taj at www.linux.org.uk Tue Jun 7 01:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 7 01:07:19 2005 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606185809.57069.qmail@web14603.mail.yahoo.com> References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: >> http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > > I'm prety sure it was there... but not anymore. > It is there. Maybe the URL got mangled. Try this http://tinyurl.com/8dfp7 It just redirects you to: http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.html -- Trent Jarvi tjarvi@qbang.org From lyon at docjava.com Tue Jun 7 12:46:39 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Jun 7 12:45:40 2005 Subject: [Rxtx] rxtx under fedora - odd procedures Message-ID: Hi All, I was able to get RXTX communications to work under Fedora, but only after I added myself to the UUCP and LOCK groups, logged out and then logged back in. Both groups appear to be needed in order to access the serial ports. Also the group alter did not take until after I logged out and logged back in. My theory is that you need permission to write to the var/spool directory under fedora and that this is the only way to do it. Logging out and logging back in just seems like an odd thing to do. I suppose some users may have to restart X. Ouch! Is this true? The alter_group command indicates that you need to be an su to alter the group database. Does this mean that my serial port users need a database su able person to use serial port applications under RXTX? If so, what is the procedure to make a transparent install work using Java web start? Should I be prompting users for the su password? Should I be telling users to exit from X and log out? Is this the way other serial communications programs work? Thanks! - Doug From sean_montgomery at baseview.com Tue Jun 7 15:14:51 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue Jun 7 15:13:50 2005 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: >>> http://java.sun.com/products/javacomm/javadocs/javax/comm/package- >>> summary.ht >>> > > >> >> I'm prety sure it was there... but not anymore. >> >> > > It is there. Maybe the URL got mangled. Try this > > http://tinyurl.com/8dfp7 > > It just redirects you to: > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > summary.html > Maybe the issue here is that the info is available without frames from that URL, but when you try to access it with frames (from the link on that page) it doesn't work - it takes you to: http://java.sun.com/products/javacomm/javadocs/index.html Which doesn't have anything useful on it. From gadelavega at yahoo.com.ar Tue Jun 7 15:22:50 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue Jun 7 15:21:56 2005 Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: Message-ID: <20050607142251.92850.qmail@web14626.mail.yahoo.com> --- "Dr. Douglas Lyon" escribi?: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the > group > alter did not take until after I logged out and > logged back in. > > My theory is that you need permission to write to > the var/spool > directory under fedora and that this is the only way > to do it. > > Logging out and logging back in just seems like an > odd thing to > do. I suppose some users may have to restart X. > Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port > applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log > out? > Is this the way other serial communications programs > work? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Actually, you need the lock group to acces /var/lock directory, and uucp to acces /dev/ttyS*. You (as root) shuold add all users you will allow to use the serial ports to group uucp and all the ones you'll allow to lock the ports to lock group (rxtx needs both). This is not only for rxtx, but for any use of the serial ports. Next time they login they'll be able to work, so if they are in they'll have to log out first. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From gadelavega at yahoo.com.ar Tue Jun 7 15:23:56 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue Jun 7 15:23:14 2005 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> Message-ID: <20050607142356.93815.qmail@web14624.mail.yahoo.com> --- Sean Montgomery escribi?: > > On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: > > >>> > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > >>> summary.ht > >>> > > > > > >> > >> I'm prety sure it was there... but not anymore. > >> > >> > > > > It is there. Maybe the URL got mangled. Try this > > > > http://tinyurl.com/8dfp7 > > > > It just redirects you to: > > > > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > > summary.html > > > > Maybe the issue here is that the info is available > without frames > from that URL, but when you try to access it with > frames (from the > link on that page) it doesn't work - it takes you > to: > > http://java.sun.com/products/javacomm/javadocs/index.html > > Which doesn't have anything useful on it. > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > That's right, my bad. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From jon.nall at gmail.com Tue Jun 7 15:33:40 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue Jun 7 15:32:39 2005 Subject: [Rxtx] performance expectations Message-ID: Hi all. I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC microcontroller. The protocol I'm using (which I didn't create) looks like this for the section of code I'm concerned with: PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data PIC -> PC: 0x01 // ACK 0xNN // First 8 bits of data 0xMM // Second 8 bits of data I issue ~2000 of these Read commands. The PIC itself has an input fifo which can store 18 bytes, so I can have 18 read commands in flight at a given time. The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k 8N1. I am measuring the time it takes to perform these 2000 commands at around 30 seconds, which is much longer than I anticipated. With the link fully utilized, I expected: Time per byte transmitted: 115200 / 8 = 14400 bytes/second = ~70 uS/byte Time per response transmitted: ~70 uS/byte * 3 bytes/response = ~210 uS/response Time for 2000 responses to be transmitted: ~210 uS/response * 2000 responses = ~420ms I'm a bit new to this, so I may have made some bad asumptions, but I would have expected a time of a couple of seconds to perform the 2000 reads, not 30+ seconds. I'm obviously missing something here. Can someone help me understand what's going on? Thanks, nall. From taj at www.linux.org.uk Tue Jun 7 16:17:48 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 7 16:15:57 2005 Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the group > alter did not take until after I logged out and logged back in. > > My theory is that you need permission to write to the var/spool > directory under fedora and that this is the only way to do it. > > Logging out and logging back in just seems like an odd thing to > do. I suppose some users may have to restart X. Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log out? > Is this the way other serial communications programs work? > RIght now, rxtx requires you do one of two things. 1) Use lock files (recommended). This requires intervention by the root users to allow users to create lock files and open the ports as you note. 2) configure rxtx with --disable-lockfiles. In this case you need only worry about the permissions on /dev/ttyS* I'm not sure what the default on Fedora is with respect to permisions. This is not very attractive. There is a better way it could be done on Fedora. Fedora comes with lockdev library. I've been considering this for some time. We could use that for the locking and do away with many of the problems. The problem is embeded devices running Linux do not come with liblockdev. But for your use, I would consider adding a new option for locking serial devices using liblockdev. lockdev-devel has a man page with further information. SYNOPSIS #include pid_t dev_testlock( const char * devname); pid_t dev_lock( const char * devname); pid_t dev_relock( const char * devname, pid_t pid); pid_t dev_unlock( const char * devname, pid_t pid); cc [ flag ... ] file ... -llockdev [ library ] This would probably need to be a configure time option to prevent problems on embeded Linux devices but could otherwise be the default on Linux. I could toss a quick patch together if this is confusing. It is actually easier than what rxtx does now. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Tue Jun 7 16:27:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 7 16:25:16 2005 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > Hi all. > I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC > microcontroller. The protocol I'm using (which I didn't create) looks like this > for the section of code I'm concerned with: > > PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data > PIC -> PC: 0x01 // ACK > 0xNN // First 8 bits of data > 0xMM // Second 8 bits of data > > I issue ~2000 of these Read commands. The PIC itself has an input fifo which > can store 18 bytes, so I can have 18 read commands in flight at a given time. > The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k > 8N1. > > I am measuring the time it takes to perform these 2000 commands at around 30 > seconds, which is much longer than I anticipated. With the link fully utilized, > I expected: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte > > Time per response transmitted: > ~70 uS/byte * 3 bytes/response = ~210 uS/response > > Time for 2000 responses to be transmitted: > ~210 uS/response * 2000 responses = ~420ms > > I'm a bit new to this, so I may have made some bad asumptions, but I would have > expected a time of a couple of seconds to perform the 2000 reads, not 30+ > seconds. > > I'm obviously missing something here. Can someone help me understand what's > going on? > I've hooked rxtx in loopback with a scope in the past at 9600 baud (baud rate is not important). Using event notification and just writing a byte on event/read the latencey was around 8-12 ms. The JNI is not an efficient way to use native code - especially for bit banging. So if timing is critical you want to move some of the logic into the native code rather than banging over the JNI. 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your performance. C# has advantages here. If you move your logic into the native layer or use gcj (rxtx will work with that too) most of your latency should vanish. You may have to play with some sleeps in eventLoop at that point to get full native efficiency. With gcj all of rxtx becomes 'native code' as java is just treated as a subset of C++. -- Trent Jarvi tjarvi@qbang.org From jon.nall at gmail.com Tue Jun 7 16:38:51 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue Jun 7 16:37:50 2005 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: On 6/7/05, Jon Nall wrote: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte of course that should be divided by 10 to account for the start/stop bits, but it barely changes the end results. From carobizar at free.fr Tue Jun 7 17:21:29 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue Jun 7 17:23:46 2005 Subject: [Rxtx] (no subject) Message-ID: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Hello ! I am a french student and I have to create an application able to read and write on serial and parallel port and to run on Windows and Linux. For the moment my program run on Windows thanks the Java Communication API (version for Microsoft Windows and Solaris/x86). But it doesn't work on Linux. Does a recent version of an installation documentation exist ? I didn't find one on the RXTX site (nothing for the windows installation and the linux installation deals with a "jcl.jar" that I don't know...). So, I have some questions : 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 version or Linux&w32 version ?) What are the differences between them ? Which of them are the most stable ? 2) Where have I to put the .so and .dll files ? 3) What have I to write on the file javax.comm.properties ? 4) Have I to delete the file win32comm.dll included in the Java Comm API ? 5) Have I to keep both comm.jar and RXTXcomm.jar ? Best regards, Caroline. From debief at telemsa.com Tue Jun 7 17:44:56 2005 From: debief at telemsa.com (DEBIEF Eric) Date: Tue Jun 7 17:47:15 2005 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: <200506071844.56656.debief@telemsa.com> Hi, We are "pushing" RxTx /Java here in a half-duplex link. The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC and application handling) about 25?s/byte. The figures are the barely the same on two environments. Environment 1 : PC : P-4@1.7 GHz, plenty of RAM. OS : Linux 2.6.3, Mdk 10.0. RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : bytes are lost on the wire. I need to investigate this mystery.... Java : 1.4.2-rc1 Blackdown Environment 2 : PC : P-4@1.7 GHz, plenty of RAM. OS : Windows 2000 Pro RxTx : 2.0.7. Java : 1.4.2_08 SUN I Hope this help, Eric. _______________________________________________ Rxtx mailing list Rxtx@mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 7 18:05:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 7 18:03:50 2005 Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, DEBIEF Eric wrote: > Hi, > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. How many write() calls is this? > > Environment 1 : > PC : P-4@1.7 GHz, plenty of RAM. > OS : Linux 2.6.3, Mdk 10.0. > RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : > bytes are lost on the wire. I need to investigate this mystery.... > Java : 1.4.2-rc1 Blackdown > > Environment 2 : > PC : P-4@1.7 GHz, plenty of RAM. > OS : Windows 2000 Pro > RxTx : 2.0.7. > Java : 1.4.2_08 SUN > In my event/read/write test I found windows was ~20% faster than linux for some reason (strange part is Windows was in VMWare on the same Linux machine). It was about the same rxtx version. There are many problems with rxtx 1.4 with respect to commapi on windows but its code paths are more simple. What some people want from rxtx is perhaps better served by hacking up the very first release as they just want to read and write which is what rxtx was before Sun released commapi. It sounds like perhaps you are pushing out larger writes which will greatly improve results. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Tue Jun 7 18:16:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 7 18:14:50 2005 Subject: [Rxtx] Installation help In-Reply-To: <1118161289.42a5c989cf6a2@imp4-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: On Tue, 7 Jun 2005 carobizar@free.fr wrote: > > Hello ! > > I am a french student and I have to create an application able to read and write > on serial and parallel port and to run on Windows and Linux. > For the moment my program run on Windows thanks the Java Communication API > (version for Microsoft Windows and Solaris/x86). > But it doesn't work on Linux. > > Does a recent version of an installation documentation exist ? > I didn't find one on the RXTX site (nothing for the windows installation and the > linux installation deals with a "jcl.jar" that I don't know...). > > So, I have some questions : > > 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 > version or Linux&w32 version ?) What are the differences between them ? Which > of them are the most stable ? > Use rxtx 2.0 with commapi for sparc solaris from Sun. If you want your current package javax.comm. > 2) Where have I to put the .so and .dll files ? On Linux just use the source, the configure script will do all of that for you. tar -xzvf rxtx-2.0-version mkdir rxtx-2.0-version/build cd rxtx-2.0-version/build ../configure && make install It will do everything for you. With Windows, you need to create the javax.comm.properties and install the DLL on your path. But you can just use Sun's package too. They are intended to be interchangable. > > 3) What have I to write on the file javax.comm.properties ? Driver=gnu.io.RXTXCommDriver More documentation in INSTALL that comes with the source. Sun's documentation should work too. configure does this for you on Linux. > > 4) Have I to delete the file win32comm.dll included in the Java Comm API ? > No > 5) Have I to keep both comm.jar and RXTXcomm.jar ? > Yes. RXTX 2.1 replaces comm.jar but the package is different (gnu.io) to avoid contaminating Sun's namespace. With rxtx 2.0 you need Sun's comm.jar - they work together. > > Best regards, > Caroline. > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi@qbang.org From dacker at nomadio.net Tue Jun 7 19:07:34 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue Jun 7 19:06:41 2005 Subject: [Rxtx] Patches to 2.1-7pre17 Message-ID: <20050607180632.1543A29D5C8@mail.electronpusher.org> Hello, I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our product includes a built in USB to Serial adapter so that when it is connected to your PC over USB, it appears as a serial port. We had problems with Sun's comm library because it did not detect serial ports coming and going properly. I did run into a few issues with RxTx though. I am building under Windows (we support XP and 2000) under cygwin. I used a simple make file for the c code that works under cygwin and ant to build the java stuff. Attached is a diff file. The patches hit the following issues: ParallelImp.c - I am not using config so there is no config.h for me. Also, gcc didn't like a local file (win32termios.h) getting included with <> . RXTXPort.java - You can get an exception during the writeByte, writeArray, nativeDrain, readByte, read, readArray, readTerminatedArray, and nativeAvailable calls. Without this patch the IOLocked count gets stuck incremented. termios.c - If you try to open a port through CreateFile and get ERROR_ACCESS_DENIED it means someone else is using the port. We need to make sure to use serial_close instead of just close. I found that some devices finish their I/O synchronously. The code was treating this as an error. I also added some checking on the ClearError calls. I found a compile error when debugging is turned on (see the usleep change). SerialImp.c - Again, I don't have a config.h and again we must use quotes and not <> to include win32termios.h . I also commented out a report call since it seems to happen constantly on my system. Feel free to use these in any way that you want or just to ignore them. Thanks! -Dave Acker dacker@nomadio.net Software Engineer Nomadio, Inc. -------------- next part -------------- Index: ParallelImp.c =================================================================== --- ParallelImp.c (.../rxtxTest/pc/java/src/gnu/io) (revision 1843) +++ ParallelImp.c (.../seriallink3/pc/java/src/gnu/io) (revision 1903) @@ -31,7 +31,9 @@ #if defined(__MWERKS__)/* dima */ #include "LPRPort.h" #else /* dima */ -#include "config.h" +#ifndef WIN32 +# include "config.h" +#endif /* work around for libc5 */ /*#include */ #include "gnu_io_LPRPort.h" @@ -46,7 +48,7 @@ # include #else # include -# include +# include "win32termios.h" #endif #include #include Index: RXTXPort.java =================================================================== --- RXTXPort.java (.../rxtxTest/pc/java/src/gnu/io) (revision 1843) +++ RXTXPort.java (.../seriallink3/pc/java/src/gnu/io) (revision 1903) @@ -1105,10 +1105,16 @@ IOLocked--; throw new IOException(); } - writeByte( b, monThreadisInterrupted ); - if (debug_write) - z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); - IOLocked--; + try + { + writeByte( b, monThreadisInterrupted ); + if (debug_write) + z.reportln( "Leaving RXTXPort:SerialOutputStream:write( int )"); + } + finally + { + IOLocked--; + } } /** * @param b[] @@ -1128,10 +1134,17 @@ if ( fd == 0 ) throw new IOException(); IOLocked++; waitForTheNativeCodeSilly(); - writeArray( b, 0, b.length, monThreadisInterrupted ); - IOLocked--; - if (debug_write) - z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + try + { + writeArray( b, 0, b.length, monThreadisInterrupted ); + if (debug_write) + z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" +b.length +")"); + } + finally + { + IOLocked--; + } + } /** * @param b[] @@ -1163,10 +1176,16 @@ } IOLocked++; waitForTheNativeCodeSilly(); - writeArray( send, 0, len, monThreadisInterrupted ); - if( debug_write ) - z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); - IOLocked--; + try + { + writeArray( send, 0, len, monThreadisInterrupted ); + if( debug_write ) + z.reportln( "Leaving RXTXPort:SerialOutputStream:write(" + send.length + " " + off + " " + len + " " +") " /*+ new String(send)*/ ); + } + finally + { + IOLocked--; + } } /** */ @@ -1188,11 +1207,17 @@ this is probably good on all OS's but for now just sendEvent from java on Sol */ - if ( nativeDrain( monThreadisInterrupted ) ) - sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); - IOLocked--; - if (debug) - z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); + try + { + if ( nativeDrain( monThreadisInterrupted ) ) + sendEvent( SerialPortEvent.OUTPUT_BUFFER_EMPTY, true ); + if (debug) + z.reportln( "RXTXPort:SerialOutputStream:flush() leave"); + } + finally + { + IOLocked--; + } } } @@ -1229,12 +1254,18 @@ waitForTheNativeCodeSilly(); if (debug_read_results) z.reportln( "RXTXPort:SerialInputStream:read() N" ); - int result = readByte(); - IOLocked--; - if (debug_read_results) - //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); - z.reportln( "RXTXPort:SerialInputStream:read() returns" ); - return( result ); + try + { + int result = readByte(); + if (debug_read_results) + //z.reportln( "RXTXPort:SerialInputStream:read() returns byte = " + result ); + z.reportln( "RXTXPort:SerialInputStream:read() returns" ); + return( result ); + } + finally + { + IOLocked--; + } } /** * @param b[] @@ -1260,11 +1291,17 @@ } IOLocked++; waitForTheNativeCodeSilly(); - result = read( b, 0, b.length); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); - IOLocked--; - return( result ); + try + { + result = read( b, 0, b.length); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read() returned " + result + " bytes" ); + return( result ); + } + finally + { + IOLocked--; + } } /* read(byte b[], int, int) @@ -1365,11 +1402,17 @@ } IOLocked++; waitForTheNativeCodeSilly(); - result = readArray( b, off, Minimum); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); - IOLocked--; - return( result ); + try + { + result = readArray( b, off, Minimum); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); + return( result ); + } + finally + { + IOLocked--; + } } /** @@ -1468,11 +1511,17 @@ } IOLocked++; waitForTheNativeCodeSilly(); - result = readTerminatedArray( b, off, Minimum, t ); - if (debug_read_results) - z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); - IOLocked--; - return( result ); + try + { + result = readTerminatedArray( b, off, Minimum, t ); + if (debug_read_results) + z.reportln( "RXTXPort:SerialInputStream:read(" + b.length + " " + off + " " + len + ") returned " + result + " bytes" /*+ new String(b) */); + return( result ); + } + finally + { + IOLocked--; + } } /** * @return int bytes available @@ -1487,12 +1536,18 @@ if ( debug_verbose ) z.reportln( "RXTXPort:available() called" ); IOLocked++; - int r = nativeavailable(); - if ( debug_verbose ) - z.reportln( "RXTXPort:available() returning " + - r ); - IOLocked--; - return r; + try + { + int r = nativeavailable(); + if ( debug_verbose ) + z.reportln( "RXTXPort:available() returning " + + r ); + return r; + } + finally + { + IOLocked--; + } } } /** Index: termios.c =================================================================== --- termios.c (.../rxtxTest/pc/java/src/gnu/io) (revision 1843) +++ termios.c (.../seriallink3/pc/java/src/gnu/io) (revision 1903) @@ -93,9 +93,20 @@ int ret; hcomm = CreateFile( filename, GENERIC_READ |GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 ); if ( hcomm == INVALID_HANDLE_VALUE ) - ret = 0; + { + if (GetLastError() == ERROR_ACCESS_DENIED) + { + ret = 1; + } + else + { + ret = 0; + } + } else + { ret = 1; + } CloseHandle( hcomm ); return(ret); } @@ -1184,7 +1195,7 @@ sprintf( message, "open(): Invalid Port Reference for %s\n", filename ); report( message ); - close( index->fd ); + serial_close( index->fd ); return -1; } @@ -1291,12 +1302,10 @@ } else { - /* ClearErrors( index, &Stat ); */ - /* report("Condition 3 Detected in write()\n"); */ - YACK(); - errno = EIO; - /* report( "serial_write bailing!\n" ); */ - return(-1); + /* Write finished synchronously. That is ok! + * I have seen this with USB to Serial + * devices like TI's. + */ } end: /* FlushFileBuffers( index->hComm ); */ @@ -2715,7 +2724,16 @@ va_start( ap, request ); - ClearErrors( index, &Stat ); + ret = ClearErrors( index, &Stat ); + if (ret == 0) + { + set_errno( EBADFD ); + YACK(); + report( "ClearError Failed! ernno EBADFD" ); + arg = va_arg( ap, int * ); + va_end( ap ); + return -1; + } switch( request ) { case TCSBRK: @@ -3139,6 +3157,7 @@ struct termios_list *index; char message[80]; COMSTAT Stat; + int ret; ENTER( "serial_select" ); if ( fd <= 0 ) @@ -3163,7 +3182,8 @@ ResetEvent( index->wol.hEvent ); ResetEvent( index->sol.hEvent ); ResetEvent( index->rol.hEvent ); - ClearErrors( index, &Stat ); + ret = ClearErrors( index, &Stat ); + if (ret == 0) goto fail; while ( wait == WAIT_TIMEOUT && index->sol.hEvent ) { if( index->interrupt == 1 ) @@ -3202,7 +3222,7 @@ } end: /* You may want to chop this out for lower latency */ - usleep(1000) + usleep(1000); LEAVE( "serial_select" ); return( 1 ); timeout: Index: SerialImp.c =================================================================== --- SerialImp.c (.../rxtxTest/pc/java/src/gnu/io) (revision 1843) +++ SerialImp.c (.../seriallink3/pc/java/src/gnu/io) (revision 1903) @@ -19,7 +19,9 @@ #if defined(__MWERKS__) /* dima */ #include "RXTXPort.h" /* dima */ #else /* dima */ -#include "config.h" +#ifndef WIN32 +# include "config.h" +#endif #include "gnu_io_RXTXPort.h" #endif /* dima */ #ifndef __LCC__ @@ -40,7 +42,7 @@ #include #include #else -# include +# include "win32termios.h" /* FIXME returns 0 in all cases on win32 #define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR) */ @@ -3483,7 +3485,9 @@ if( ! eis->eventflags[SPE_OUTPUT_BUFFER_EMPTY] ) { - report( "check_line_status_registe OUPUT_BUFFER_EMPTY not set\n" ); + /* This occurs constantly so remove for now + * report( "check_line_status_registe OUPUT_BUFFER_EMPTY not set\n" ); + */ return 0; } if ( fstat( eis->fd, &fstatbuf ) ) From jon.nall at gmail.com Tue Jun 7 19:28:16 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue Jun 7 19:27:15 2005 Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, DEBIEF Eric wrote: > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. Hi. This is helpful, thanks. I can think of 2 reasons I'm not collecting the data as fast as I think I should be: 1) the device to PC connection is not at 100% utilization 2) my SerialPortEventListener processing has too much overhead Are there other explanations I might be missing as to why it takes so long to transfer the data? Thanks. nall. From taj at www.linux.org.uk Tue Jun 7 20:21:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 7 20:19:53 2005 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > On 6/7/05, DEBIEF Eric wrote: > > We are "pushing" RxTx /Java here in a half-duplex link. > > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > > and application handling) about 25?s/byte. > > The figures are the barely the same on two environments. > > Hi. > This is helpful, thanks. I can think of 2 reasons I'm not collecting > the data as fast as I think I should be: > 1) the device to PC connection is not at 100% utilization > 2) my SerialPortEventListener processing has too much overhead > > Are there other explanations I might be missing as to why it takes so > long to transfer the data? > Polling the port would probably make more sense. You can set the threshold/timeouts to avoid racing and not deal with the event notification. As mentioned earlier I think the event latency is ~10ms. Keep the event listener around, rxtx 2.* does not close well without it. -- Trent Jarvi tjarvi@qbang.org From jon.nall at gmail.com Tue Jun 7 20:27:27 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue Jun 7 20:26:25 2005 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, Trent Jarvi wrote: > Polling the port would probably make more sense. You can set the > threshold/timeouts to avoid racing and not deal with the event > notification. As mentioned earlier I think the event latency is ~10ms. Trent, Thanks for the response. Just to make sure I understand what you're talking about, when you say event latency, do you mean the time it takes from when the byte hits the PC's comm port to when rxtx presents it to user code? So if the link is 100% utilized, will my user code see "hiccups" or a steady stream of data? Thanks for helping a serial port newbie. nall. From dacker at nomadio.net Tue Jun 7 20:32:20 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue Jun 7 20:31:24 2005 Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <20050607193118.5499329CAA0@mail.electronpusher.org> Some folks asked about the make file and ant steps. I have JAVA_HOME set as follows: $ echo $JAVA_HOME C:\Program Files\Java\jdk1.5.0_01 I have all the code in rxtx/src put into gnu/io . The make file here doesn't have optimizations turned on. We have not tested with it yet. --------------Begin Makefile------------------ CPPFLAGS="-I$(JAVA_HOME)/include" "-I$(JAVA_HOME)/include/win32" SOBJECTS=SerialImp.o fuserImp.o termios.o fixup.o init.o POBJECTS=ParallelImp.o termios.o init.o DLLS=rxtxParallel.dll rxtxSerial.dll all: $(CLASSES) $(DLLS) rxtxSerial.dll: $(SOBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(SOBJECTS) rxtxParallel.dll: $(POBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(POBJECTS) clean: rm -fv $(SOBJECTS) $(POBJECTS) $(DLLS) %.o: %.c gcc -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< %.o: %.cpp g++ -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< --------------End Makefile------------------ Here is the ant target I use to build the rxtx libs. Our build puts the class files in a bin dir. We copy the dlls to a deploy dir and to the build dir. Eclipse seems to like the dlls in the build dir. The deploy dir is used when we build our full package. --------------Begin Ant Section------------------ --------------End Ant Section------------------ > -----Original Message----- > From: rxtx-bounces@mail.electronpusher.org > [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of > David S. Acker > Sent: Tuesday, June 07, 2005 2:08 PM > To: 'Java RXTX discussion' > Subject: [Rxtx] Patches to 2.1-7pre17 > > Hello, > I am using RxTx with the Nomadio Sensor, > http://www.nomadio.net/ . Our product includes a built in > USB to Serial adapter so that when it is connected to your PC > over USB, it appears as a serial port. We had problems with > Sun's comm library because it did not detect serial ports > coming and going properly. > > I did run into a few issues with RxTx though. I am building > under Windows (we support XP and 2000) under cygwin. I used > a simple make file for the c code that works under cygwin and > ant to build the java stuff. Attached is a diff file. The > patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h > for me. Also, gcc didn't like a local file (win32termios.h) > getting included with <> . > > RXTXPort.java - You can get an exception during the > writeByte, writeArray, nativeDrain, readByte, read, > readArray, readTerminatedArray, and nativeAvailable calls. > Without this patch the IOLocked count gets stuck incremented. > > termios.c - If you try to open a port through CreateFile and > get ERROR_ACCESS_DENIED it means someone else is using the > port. We need to make sure to use serial_close instead of > just close. I found that some devices finish their I/O > synchronously. The code was treating this as an error. I > also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we > must use quotes and not <> to include win32termios.h . I > also commented out a report call since it seems to happen > constantly on my system. > > Feel free to use these in any way that you want or just to > ignore them. > Thanks! > > -Dave Acker > dacker@nomadio.net > Software Engineer > Nomadio, Inc. > From taj at www.linux.org.uk Tue Jun 7 20:37:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 7 20:35:52 2005 Subject: [Rxtx] Re: Stack Smashing Attack In-Reply-To: <200506072012.48860.ferdinand.tatzig@web.de> References: <200506072012.48860.ferdinand.tatzig@web.de> Message-ID: On Tue, 7 Jun 2005, Ferdinand Tatzig wrote: > Dear Trent > > I am using RXTX for serial port communication between a PC and a payment > transaction terminal. > When I run my application under Windows 2000, an i386-Linux or an i386-FreeBSD > it works as I expect it to do. However, when I start it to run on AMD64 > machine with a 64-bit Gentoo Linux, the VM terminates with the following > error: > > Port found: /dev/ttyS0 > java: stack smashing attack in function configure_port() > > I am using a 64-bit Blackdown-1.4.2-01 VM. > > I have searched the internet but have found no information about this error. > > This is the code of the method which initializes the serial port: > > /** > * initializes a serial port for communication with a terminal; only > * accessible within this class > * > * @param communication > * @param serialPortToBeInitialized > * @param tillInterfaceEventListener > */ > private TillInterfaceSerialPort(Communication communication, > String serialPortToBeInitialized, > TillInterfaceEventListener tillInterfaceEventListener) > throws IOException, PortInUseException, > TillInterfaceSerialPortNotFoundException, > TooManyListenersException, UnsupportedCommOperationException { > serialPortName = "not initialized yet"; > CommPortIdentifier portId = null; > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > boolean portFound = false; > String temporarySerialPortName = "not initialized yet"; > > // look for a serial port > while (portList.hasMoreElements() && !portFound) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > temporarySerialPortName = portId.getName(); > if (temporarySerialPortName.equals(serialPortToBeInitialized)) { > System.out.print("Port found: "); > System.out.println(temporarySerialPortName); > serialPortName = temporarySerialPortName; > portFound = true; > } > } > } > if (portFound) { > > // initialize the found port - this command causes the VM to terminate > serialPort = (SerialPort) portId > .open( > TillInterfaceConstants.APPLICATION_NAME, > TillInterfaceConstants > .TIMEOUT_IN_MILLISECONDS_FOR_OPENING_OF_COMMUNICATION_PORT); > > // add an event listener which listens > // on the serial port and notifies the > // serial port object when input bytes > // have been received at the port > serialPort.addEventListener(tillInterfaceEventListener); > serialPort.notifyOnDataAvailable(true); > > // initialize the physical layer > // parameters of the serial port > serialPort.setSerialPortParams(TillInterfaceConstants.BAUD_RATE, > SerialPort.DATABITS_8, SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > // set the inter-character > // timeout (T2) > serialPort > .enableReceiveTimeout(TillInterfaceConstants.INTERCHARACTER_TIMEOUT_IN_MILLISECONDS); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > } else > throw new TillInterfaceSerialPortNotFoundException(); > } > > Any hint to solve this problem would be kindly appreciated. > The only thing that comes to mind here after looking at the offending function is rxtx used to include asm/termios.h but now we moved to termios.h and had glibc fix their headers. The asm/termios.h caused problems as its termios was smaller than the actual termios. This should be fixed in current rxtx versions but you can just glance at SerialImp.c and make sure it does not include asm/termios.h. I've cc'd the rxtx mail list because there was one other mention of stack problems recently. I have used rxtx on opteron systems with success. I have a bug I'm trying hard to reproduce on suse 64 bit (circa linux 2.4.19) systems though. So far I have not been able to reproduce the bug. That said, with gentoo... I like gentoo but I seriously doubt they do any QA with their kernel and Java. I've seen problems before. If you use gentoo and have Java problems, at least stick to Linus (that is an s there) kernels while using Java. I'm not an expert on gentoo but I've seen patches go into experimental kernels that turn out to break java and are reverted before going to Linus just before I see problems with gentoo on this list. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Tue Jun 7 21:16:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 7 21:14:21 2005 Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: On Tue, 7 Jun 2005, David S. Acker wrote: > Hello, > I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our > product includes a built in USB to Serial adapter so that when it is > connected to your PC over USB, it appears as a serial port. We had problems > with Sun's comm library because it did not detect serial ports coming and > going properly. > > I did run into a few issues with RxTx though. I am building under Windows > (we support XP and 2000) under cygwin. I used a simple make file for the c > code that works under cygwin and ant to build the java stuff. Attached is a > diff file. The patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h for me. Also, > gcc didn't like a local file (win32termios.h) getting included with <> . > > RXTXPort.java - You can get an exception during the writeByte, writeArray, > nativeDrain, readByte, read, readArray, readTerminatedArray, and > nativeAvailable calls. Without this patch the IOLocked count gets stuck > incremented. > > termios.c - If you try to open a port through CreateFile and get > ERROR_ACCESS_DENIED it means someone else is using the port. We need to > make sure to use serial_close instead of just close. I found that some > devices finish their I/O synchronously. The code was treating this as an > error. I also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we must use quotes > and not <> to include win32termios.h . I also commented out a report call > since it seems to happen constantly on my system. > > Feel free to use these in any way that you want or just to ignore them. > Thanks! > Hi Dave These patches look great as is. Thanks. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Tue Jun 7 21:33:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 7 21:31:21 2005 Subject: [Rxtx] Patch to IOLocked (fwd) Message-ID: This appears to be another solution to the locking. Chris, the other option just moves the locking into the finally clause which I think would be a little cleaner though I'm posting this patch to so people can comment. -- Trent Jarvi tjarvi@qbang.org ---------- Forwarded message ---------- Date: Wed, 1 Jun 2005 13:01:32 +0100 From: Christopher Dawes To: taj@www.linux.org.uk Subject: Patch to IOLocked Do you want me to check it out of CVS and then submit changes? Christopher -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXPort.java.diff Type: application/octet-stream Size: 6965 bytes Desc: Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050607/c442f9fc/RXTXPort.java-0001.obj From Christopher.Dawes at retail-logic.com Wed Jun 8 07:57:24 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed Jun 8 07:58:30 2005 Subject: [Rxtx] Patch to IOLocked (fwd) [Virus Checked] In-Reply-To: Message-ID: Agreed, much better Java :-) Thanks Christopher ------------------------------------------- Consultant Engineer Retail Logic Limited Fleet GU51 3TZ Tel: +44 (0)1252 644377 Mob: +44 (0)7899 842759 Fax: +44 (0)1252 776708 rxtx-bounces@mail.electronpusher.org wrote on 07/06/2005 21:33:16: > > This appears to be another solution to the locking. Chris, the other > option just moves the locking into the finally clause which I think would > be a little cleaner though I'm posting this patch to so people can > comment. > > -- > Trent Jarvi > tjarvi@qbang.org > > ---------- Forwarded message ---------- > Date: Wed, 1 Jun 2005 13:01:32 +0100 > From: Christopher Dawes > To: taj@www.linux.org.uk > Subject: Patch to IOLocked > > Do you want me to check it out of CVS and then submit changes? > > Christopher[attachment "RXTXPort.java.diff" deleted by Chris > Dawes/Retaillogic/NISABA] _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx From zempftman at gmail.com Wed Jun 8 14:57:25 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed Jun 8 14:56:25 2005 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Maxwell Zempftman Date: May 27, 2005 5:01 PM Subject: Re: [Rxtx] Kaffe & rxtx & armv5b To: rxtx@mail.linuxgrrls.org Here are the results from working this week: The "NullPointerExceptions" are generated by the software when I choose a bad device file. I discovered that this occurs on the i686-RedHat box as well. This exception seems to be generated only by this particular application, and not by the example programs in contrib. So, for example: java MyApp /dev/null <-- generates NullPointerException java MyApp fake <-- generates NullPointerException java MyApp /dev/ttyS0 <-- does not generate NullPointerException Using the program CommCheck (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it appears as though /dev/ttyS0 is the only valid serial device file on the XScale device, so the errors I was getting are not really be bugs. Although /dev/ttyS0 did not generate NullPointerExceptions, I did encounter this error: --start java MyApp /dev/ttyS0 (going mostly from memory, not exact) PortList.hasMoreElements: true Listening on: /dev/ttyS0 Client connected. >From net: echo kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 vmExcept_setJNIFrame Assert: on 'fp != 0' failed. --end I took a look at exception.h, and it seems as though the problematic code does not exist in newer versions of Kaffe (I have been using CVS-2004-11). Next week I will try to use a newer version, although so far everything but CVS-2004-11 has failed. Also, I the device files I need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with something like this? Thanks, Max. > On 5/21/05, Trent Jarvi wrote: > > I'm not sure what is wrong in the first part. It sounds like your > > application may be swallowing an exception while trying to enumerate the > > port or open it. The usual mistake made it not having permissions to > > either open the port or create the lockfile. There should be examples in > > the contrib directory you can try that enumerate and open ports. Maybe > > that will give you some hints. > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > Sun's code limiting you there though you do need to compile and install > > rxtx for the XScale with Sun's Commapi. > > > > -- > > Trent Jarvi > > tjarvi@qbang.org > > From taj at www.linux.org.uk Wed Jun 8 15:22:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Jun 8 15:20:47 2005 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > ---------- Forwarded message ---------- > From: Maxwell Zempftman > Date: May 27, 2005 5:01 PM > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > To: rxtx@mail.linuxgrrls.org > > > Here are the results from working this week: > > The "NullPointerExceptions" are generated by the software when I > choose a bad device file. I discovered that this occurs on the > i686-RedHat box as well. This exception seems to be generated only by > this particular application, and not by the example programs in > contrib. So, for example: > > java MyApp /dev/null <-- generates NullPointerException > java MyApp fake <-- generates NullPointerException > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > Using the program CommCheck > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > appears as though /dev/ttyS0 is the only valid serial device file on > the XScale device, so the errors I was getting are not really be bugs. > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > encounter this error: > > --start > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > PortList.hasMoreElements: true > Listening on: /dev/ttyS0 > Client connected. > >From net: echo > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > --end > > I took a look at exception.h, and it seems as though the problematic > code does not exist in newer versions of Kaffe (I have been using > CVS-2004-11). Next week I will try to use a newer version, although so > far everything but CVS-2004-11 has failed. Also, I the device files I > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > something like this? > In RXTXCommDriver, just look for the following code and add /dev/ttyM to the list. Moxa? if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } So: if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyM", // for Moxa ports "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } Linux just has way too many port types to try enumerating them all. There is potential we can add them back in with udev now. > Thanks, > Max. > > > On 5/21/05, Trent Jarvi wrote: > > > I'm not sure what is wrong in the first part. It sounds like your > > > application may be swallowing an exception while trying to enumerate the > > > port or open it. The usual mistake made it not having permissions to > > > either open the port or create the lockfile. There should be examples in > > > the contrib directory you can try that enumerate and open ports. Maybe > > > that will give you some hints. > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > Sun's code limiting you there though you do need to compile and install > > > rxtx for the XScale with Sun's Commapi. > > > > > > -- > > > Trent Jarvi > > > tjarvi@qbang.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi@qbang.org From slavelle at atcorp.com Wed Jun 8 19:16:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed Jun 8 19:15:05 2005 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A60B8D.8080500@cs.umn.edu> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> Message-ID: <42A735E3.8040706@atcorp.com> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual serial comport. This isn't so much of a problem, what is, however, is that the comport does not appear to be able to be set to any arbitrary speed, only those from the data_rate enum. I've not found much on using different speeds, has anyone else encountered anything similar? I greatly appreciate any and all comments and suggestions. Thanks in advance, ~ Shawn Lavelle From zempftman at gmail.com Wed Jun 8 19:50:58 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed Jun 8 19:50:21 2005 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: Thanks Trent! That will solve one of the problems. I don't know when my next chance to work on it will be, but I still need to figure out the error I got when I tried opening '/dev/ttyS0' on the Moxa device regarding a failed assertion, seemed to be a Kaffe issue. Thanks for you help, hope to have results soon, Max Englander. On 6/8/05, Trent Jarvi wrote: > On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > > > ---------- Forwarded message ---------- > > From: Maxwell Zempftman > > Date: May 27, 2005 5:01 PM > > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > > To: rxtx@mail.linuxgrrls.org > > > > > > Here are the results from working this week: > > > > The "NullPointerExceptions" are generated by the software when I > > choose a bad device file. I discovered that this occurs on the > > i686-RedHat box as well. This exception seems to be generated only by > > this particular application, and not by the example programs in > > contrib. So, for example: > > > > java MyApp /dev/null <-- generates NullPointerException > > java MyApp fake <-- generates NullPointerException > > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > > > Using the program CommCheck > > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > > appears as though /dev/ttyS0 is the only valid serial device file on > > the XScale device, so the errors I was getting are not really be bugs. > > > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > > encounter this error: > > > > --start > > > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > > > PortList.hasMoreElements: true > > Listening on: /dev/ttyS0 > > Client connected. > > >From net: echo > > > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > > > --end > > > > I took a look at exception.h, and it seems as though the problematic > > code does not exist in newer versions of Kaffe (I have been using > > CVS-2004-11). Next week I will try to use a newer version, although so > > far everything but CVS-2004-11 has failed. Also, I the device files I > > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > > something like this? > > > > > In RXTXCommDriver, just look for the following code and add /dev/ttyM to > the list. Moxa? > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > So: > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyM", // for Moxa ports > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > Linux just has way too many port types to try enumerating them all. There > is potential we can add them back in with udev now. > > > > > Thanks, > > Max. > > > > > On 5/21/05, Trent Jarvi wrote: > > > > I'm not sure what is wrong in the first part. It sounds like your > > > > application may be swallowing an exception while trying to enumerate the > > > > port or open it. The usual mistake made it not having permissions to > > > > either open the port or create the lockfile. There should be examples in > > > > the contrib directory you can try that enumerate and open ports. Maybe > > > > that will give you some hints. > > > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > > Sun's code limiting you there though you do need to compile and install > > > > rxtx for the XScale with Sun's Commapi. > > > > > > > > -- > > > > Trent Jarvi > > > > tjarvi@qbang.org > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- > Trent Jarvi > tjarvi@qbang.org > From taj at www.linux.org.uk Wed Jun 8 19:53:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Jun 8 19:51:35 2005 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A735E3.8040706@atcorp.com> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: On Wed, 8 Jun 2005, Shawn Lavelle wrote: > Hello, > I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate > with a virtual serial comport. This isn't so much of a problem, what > is, however, is that the comport does not appear to be able to be set to > any arbitrary speed, only those from the data_rate enum. I've not found > much on using different speeds, has anyone else encountered anything > similar? I greatly appreciate any and all comments and suggestions. > This problem is a bit more tricky than it should be. POSIX systems just have a few specified baud rates. Solaris is one of these systems. CommAPI baud rates probably came from someone looking at Solaris. RXTX tries to be POSIX like. W32 is treated as a POSIX like system via a termios.c file in rxtx. Serial ports have baudbase and divisor. So you can set these to come close to the baudrate you want. Some funky equipment like automobile test equipment use baud rates that are not really possible with PC hardware. But if you get as close as possible by changing baud base and divisor, it works. Windows can actually do this for you. I don't know exactly what their code does but if you pass a baudrate to windows, it will guestimate a baudbase and divisor. So you just pass it 10200 baud and it does its job. This is not of very much use the way rxtx does things though. Linux has the standard POSIX like baud rates but if you set the baud rate to B38400, you can set your own baud base and divisor. This is not POSIX that I know of. W32 has more capability than POSIX like systems too. So I did some work to have windows work like Linux via termios.c But the code is not quit right. SerialImp.c and termios.c need some work so all the various buadrates work on Linux and W32. Most other systems will not work beyond what CommAPI already specifies without writting kernel drivers. This is on my todo list but if someone gets to it first, all the better. -- Trent Jarvi tjarvi@qbang.org From carobizar at free.fr Thu Jun 9 13:39:10 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Thu Jun 9 13:38:07 2005 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: <1118320750.42a8386e6d3ce@imp5-q.free.fr> Hi ! Thank you for all your advices. I managed to use rxtx on Windows but I have still some difficulties on Linux. I have yet follow your instructions and the configure file has created : - librxtxSerial.so and librxtxParallel.so in the directory /usr/java/j2sdk1.4.2_08/jre/lib/i386 - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the directory /usr/java/j2sdk1.4.2_08/jre/lib - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext But when I run my program, Some exceptions occur : Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver So, 1) What have I forgotten ? 2) Is it possible to make my application run on Linux without the jdk (only the jre) ? Best regards, Caroline. From taj at www.linux.org.uk Thu Jun 9 14:28:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu Jun 9 14:26:03 2005 Subject: [Rxtx] Installation help In-Reply-To: <1118320750.42a8386e6d3ce@imp5-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: On Thu, 9 Jun 2005 carobizar@free.fr wrote: > Hi ! > Thank you for all your advices. > I managed to use rxtx on Windows but I have still some difficulties on Linux. > I have yet follow your instructions and the configure file has created : > - librxtxSerial.so and librxtxParallel.so in the directory > /usr/java/j2sdk1.4.2_08/jre/lib/i386 > - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the > directory /usr/java/j2sdk1.4.2_08/jre/lib > - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext > > But when I run my program, Some exceptions occur : > Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while > loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > com.sun.comm.SolarisDriver > > So, > 1) What have I forgotten ? > The native (.so) libraries are not installed in a directory the JRE is looking for native libraries in. You may look around and see where the .so libraries are in the JRE. I don't know that the jre/lib/i386 directory is specified as a required directory for JREs. I noticed some do not use it. You may try printing the java.libarary.path to see your options. It is also possible to alter the java.library.path. > 2) Is it possible to make my application run on Linux without the jdk (only the > jre) ? Yes. Though installation from source with the JDK is less error prone. -- Trent Jarvi tjarvi@qbang.org From jon.nall at gmail.com Mon Jun 13 20:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon Jun 13 20:46:44 2005 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 22:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon Jun 13 22:23:34 2005 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen@lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Tue Jun 14 02:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue Jun 14 02:26:17 2005 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces@mail.electronpusher.org > [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen@lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Tue Jun 14 02:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Tue Jun 14 03:10:17 2005 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen@lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Tue Jun 14 03:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue Jun 14 03:50:13 2005 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces@mail.electronpusher.org > [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen@lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 09:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue Jun 14 09:17:04 2005 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 22:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 14 22:05:05 2005 Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar@free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi@qbang.org From lmangold at gmail.com Tue Jun 14 22:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue Jun 14 22:05:19 2005 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 22:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Jun 14 22:12:13 2005 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 22:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue Jun 14 22:17:11 2005 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 22:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 14 22:30:13 2005 Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi@qbang.org From slavelle at atcorp.com Tue Jun 14 22:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue Jun 14 22:32:10 2005 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 22:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 14 22:38:40 2005 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi@qbang.org From slavelle at atcorp.com Tue Jun 14 23:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue Jun 14 23:13:10 2005 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 23:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue Jun 14 23:22:57 2005 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces@mail.electronpusher.org [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx@mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 23:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 14 23:27:09 2005 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi@qbang.org From slavelle at atcorp.com Wed Jun 15 00:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed Jun 15 00:06:00 2005 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx@mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Wed Jun 15 00:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Jun 15 00:56:18 2005 Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous@cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Wed Jun 15 04:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Jun 15 04:57:15 2005 Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi@qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj@www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 09:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed Jun 15 09:29:19 2005 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces@mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx@mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx@mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 10:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed Jun 15 10:51:36 2005 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 15:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed Jun 15 15:01:24 2005 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes@retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces@mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx@mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 15:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed Jun 15 16:00:33 2005 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces@mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes@retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces@mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx@mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx@mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 16:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed Jun 15 16:12:07 2005 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 16:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed Jun 15 16:32:55 2005 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 17:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Jun 15 17:26:53 2005 Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi@qbang.org From frank-list at uol.com.br Wed Jun 15 17:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed Jun 15 17:49:06 2005 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 18:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Jun 15 18:05:03 2005 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi@qbang.org From frank-list at uol.com.br Wed Jun 15 20:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed Jun 15 20:45:16 2005 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 21:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu Jun 16 15:16:20 2005 Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi@qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 15:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu Jun 16 15:31:48 2005 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi@qbang.org From mark at panonet.net Thu Jun 16 16:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu Jun 16 16:04:15 2005 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); From taj at www.linux.org.uk Thu Jun 16 16:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu Jun 16 16:25:59 2005 Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi@qbang.org From dimitris at gmail.com Thu Jun 16 16:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu Jun 16 16:37:31 2005 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 09:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri Jun 17 09:36:10 2005 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 15:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 17 15:53:19 2005 Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi@qbang.org From dimitris at gmail.com Fri Jun 17 19:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri Jun 17 19:57:03 2005 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 20:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 17 20:13:54 2005 Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi@qbang.org From lavelle at cs.umn.edu Tue Jun 14 23:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Fri Jun 17 20:14:52 2005 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 19:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri Jun 17 20:14:59 2005 Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi@qbang.org > > From lavelle at cs.umn.edu Tue Jun 7 22:03:09 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Fri Jun 17 20:15:09 2005 Subject: [Rxtx] Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <42A60B8D.8080500@cs.umn.edu> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual comport. This isn't so much of a problem, what is, however, is that the comport is only ever set to 9600 baud. I've not found this as a documented bug, has anyone else encountered anything similar? I'll try and provide more detail tomorrow, but if anyone has any suggestions or encountered this before, I'd like to hear about it. Thanks in advance, ~ Shawn Lavelle From lavelle at cs.umn.edu Tue Jun 14 23:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Fri Jun 17 20:15:24 2005 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx@mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 17:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Fri Jun 17 20:15:33 2005 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes.vcf From d.tonhofer at m-plify.com Fri Jun 17 20:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri Jun 17 20:31:33 2005 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 20:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri Jun 17 20:37:52 2005 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 20:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 17 20:53:04 2005 Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi@qbang.org From slavelle at atcorp.com Fri Jun 17 21:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri Jun 17 21:10:44 2005 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle@cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Sat Jun 18 02:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat Jun 18 02:05:57 2005 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces@mail.electronpusher.org [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx@mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx@mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Sat Jun 18 02:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat Jun 18 02:08:52 2005 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces@mail.electronpusher.org [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx@mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Sat Jun 18 02:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat Jun 18 02:27:21 2005 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces@mail.electronpusher.org > [mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx@mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi@qbang.org From dimitris at gmail.com Sat Jun 18 04:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat Jun 18 04:23:28 2005 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Sat Jun 18 04:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat Jun 18 04:55:18 2005 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi@qbang.org From dimitris at gmail.com Sat Jun 18 11:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat Jun 18 11:35:59 2005 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 17:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat Jun 18 16:58:58 2005 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 17:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat Jun 18 17:23:23 2005 Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Sat Jun 18 17:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat Jun 18 17:37:35 2005 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Sat Jun 18 20:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat Jun 18 20:48:30 2005 Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi@qbang.org From ricardo.trindade at emation.pt Sat Jun 18 21:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat Jun 18 21:36:36 2005 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 22:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat Jun 18 22:49:46 2005 Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi@qbang.org From ricardo.trindade at emation.pt Sat Jun 18 23:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat Jun 18 23:39:37 2005 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment.htm From taj at www.linux.org.uk Sun Jun 19 00:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun Jun 19 00:03:22 2005 Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi@qbang.org From ricardo.trindade at emation.pt Sun Jun 19 12:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun Jun 19 12:38:51 2005 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0001.htm From taj at www.linux.org.uk Sun Jun 19 18:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun Jun 19 18:37:47 2005 Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Sun Jun 19 22:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun Jun 19 22:02:58 2005 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi@qbang.org From ricardo.trindade at emation.pt Mon Jun 20 08:04:40 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon Jun 20 08:03:24 2005 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: <42B66A88.4060806@emation.pt> An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050620/9be208a1/attachment.htm From fbalzarro at libero.it Mon Jun 20 09:33:52 2005 From: fbalzarro at libero.it (Fabio Balzarro) Date: Mon Jun 20 09:32:35 2005 Subject: [Rxtx] RXTXPort:close detected bad file descriptor Message-ID: I'm using RXTX libraries on IPAQ 4150 PDA with Windows CE 4.20 and Jeode. When I close a serial port with sp.close() (where sp is a SerialPort) sometimes an error occour 1119256168085: RXTXPort:close detected bad file descriptor What can I do? Thanks Fabio ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From slavelle at atcorp.com Mon Jun 20 15:08:19 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon Jun 20 15:07:16 2005 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: <42B6CDD3.4040409@atcorp.com> It turns out that I did have a driver-not-used issue which has now been resolved and I can use RxTx on it (had to add ttyUSB as a valid port), but only at standard baud rates. Does USB have the same restrictions on port speed as regular RS232? ~ Shawn Trent Jarvi wrote: > Just a note here. > > I have requested a FTDI usb device and they offered to send one for the > purpose of trying to get rxtx working. I have no idea how long that takes > though. > > > On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > > >>I'm afraid we're just using the latest version from the FTDI website. I've >>not yet played with linux properly with this and unfortunately I run gentoo >>and haven't yet successfully compiled in the ftdi driver. I'll let you know >>if I get any success. >> >>Appologies >> >>Christopher >> >>-----Original Message----- >>From: rxtx-bounces@mail.electronpusher.org >>[mailto:rxtx-bounces@mail.electronpusher.org] On Behalf Of Shawn Lavelle >>Sent: 15 June 2005 00:00 >>To: Java RXTX discussion >>Subject: Re: [Rxtx] Virtual Com Ports >> >>Hmm, the latter sounds like a lot of work. It does find the virtual comport >>in windows, i must have just missed it earlier (sign of a long day). On the >>linux side, I suspect that something is not correct with the driver >>installation becuase it does not give me a tty for it :( >> >>Christopher, May I ask what driver you are using for your FTDI chip? >>Did you ever encounter problems with not getting a tty assigned for it? >> >> >> Thanks for all your help! >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>They will have to show up as a tty device in Linux. Probably ttyUSB? >>>That will need an entry in RXTXCommDriver.java. If they dont show up >>>as a tty device, rxtx cant treat it like a serial port. It just wont >> >>work. >> >>>With COM3, rxtx will try to open the port and perform a timed out read. >>>Usually if a port is not there, the read blows up or the open blows up. >>>Timing out is fine. COM3 used to share interrupts with COM1. I know >>>you can reassign ports in XP. RXTX scans up through COM255. You may >>>try moving it. >>> >>> >>>The code in question is the following in RXTXCommDriver.java >>> >>> >>> if(osName.equals("Linux")) >>> { >>> String[] Temp = { >>> "ttyS", // linux Serial Ports >>> "ttySA", // for the IPAQs >>> "ttyUSB" // for USB frobs >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>> else if(osName.toLowerCase().indexOf("windows") != -1 ) >>> { >>> String[] Temp = { >>> "COM" // win32 serial ports >>> //"//./COM" // win32 serial ports >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>>If COM3 can be read, it should be found. the ttyUSB should work if >>>thats in the version of RXTXCommDriver.java you have. >>> >>>If this is still a problem, it may be that the driver is erroring on >>>what may be considered normal comm port operations such as setting the >>>speed, timeout, threshold, .. One would have to start looking at each >>>function called in the native open() and read(). >>> >>> >>> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>>seems to find the device using rxtx. Looking at the hardware >>>>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>>>linux. I can't seem to get it to show up as a tty(s#) in linux which >>>>is probably just due to my lack of significant linux knowledge. >>>> >>>> ~ Shawn >>>> >>>>Trent Jarvi wrote: >>>> >>>> >>>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>Has anyone here noticed that virtual comports do not get enumerated >>>>>>via CommPortIdentifier.getPortIdentifiers()?? >>>>>> >>>>>>The device I'm trying to talk to uses an fdti usb to serial >>>>>>convertor with a driver that has it show up as a virtual comport. I >>>>>>can enter this port manually and it will be usable but I cannot get >>>>>>it show up automatically (as in the simple serial demo). Any thoughts >> >>on this? >> >>>>> >>>>>Hi Shawn, >>>>> >>>>>What OS is this and what is the name of the virtual port you are >>>>>trying to open? I suspect the name just needs to be added to >> >>RXTXCommDriver.java. >> >>>>_______________________________________________ >>>>Rxtx mailing list >>>>Rxtx@mail.electronpusher.org >>>>http://www.electronpusher.org/mailman/listinfo/rxtx >>>> >>> >>> >>_______________________________________________ >>Rxtx mailing list >>Rxtx@mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx@mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From lyon at docjava.com Mon Jun 20 22:06:08 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon Jun 20 22:04:57 2005 Subject: [Rxtx] testing Message-ID: Hi All, I am testing my new multi-platform Java Webstart RXTX application (Trent: I could not have done it without you!). So far, I think it will work under Linux (x86), Windows XP, Windows 2000 and MacOS X. The application is available as a Java webstart application at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Edit:Preferences: SerialPort Setup... should bring up a dialog box that enables dialing via the modem. Generally, it does not find internal modems (except on the mac). Why, I don't know. Thanks in advance for trying this new app. All feedback on it is welcome. - Doug Lyon From jasmine at electronpusher.org Tue Jun 21 11:15:53 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Tue Jun 21 11:14:48 2005 Subject: [Rxtx] testing In-Reply-To: References: Message-ID: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > Hi All, > I am testing my new multi-platform Java Webstart RXTX application > (Trent: I could not have done it without you!). > > So far, I think it will work under Linux (x86), Windows XP, > Windows 2000 and MacOS X. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. -J. From taj at www.linux.org.uk Tue Jun 21 12:50:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 21 12:47:47 2005 Subject: [Rxtx] testing In-Reply-To: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> References: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> Message-ID: On Tue, 21 Jun 2005, Jasmine Strong wrote: > > On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > > > Hi All, > > I am testing my new multi-platform Java Webstart RXTX application > > (Trent: I could not have done it without you!). > > > > So far, I think it will work under Linux (x86), Windows XP, > > Windows 2000 and MacOS X. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > on my Mac. > passing -source 1.3 -target 1.3 to javac will compile classes without this problem. -- Trent Jarvi tjarvi@qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 17:19:25 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue Jun 21 17:18:21 2005 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. Sincerely, Jeremyah Payne From ricardo.trindade at emation.pt Tue Jun 21 20:25:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Jun 21 20:23:54 2005 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B8698C.2060509@emation.pt> Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx@mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > From taj at www.linux.org.uk Tue Jun 21 20:39:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 21 20:37:11 2005 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <42B8698C.2060509@emation.pt> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> <42B8698C.2060509@emation.pt> Message-ID: It looks like he has an rs422 device/converter. This is not the problematic 'trying to do protocol X with a serial port' situation unless I'm missing something. I'll follow up with the other email I started. On Tue, 21 Jun 2005, Ricardo Trindade wrote: > Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. > > Payne, Jeremyah L (N-CIM) wrote: > > >Good morning, my name is Jeremyah and I am working on a java project to > >interface with some devices. In short, I have a laptop with a PCMIA > >converter that does RS422 running windows 2000. I also will be > >installing some PCI cards into some Linux boxes that will have probably > >4-8 RS422 ports on them. After doing some reading in order to talk > >with these items using my existing java code I will need an additional > >driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > >trying to get a map sort of where I need to make changes. As I see it, > >I would need to subclass SerialPort to my RS422 interface. That would > >link with a DLL or SO implementation that talks with the hardware. I > >also need to change the listing of working ports in the lookup section > >for serial. Does this seem like I am on the right track? Appreciate > >the support. > > > > > >Sincerely, > >Jeremyah Payne > >_______________________________________________ > >Rxtx mailing list > >Rxtx@mail.electronpusher.org > >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Tue Jun 21 20:40:25 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 21 20:38:06 2005 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: On Tue, 21 Jun 2005, Payne, Jeremyah L (N-CIM) wrote: > Good morning, my name is Jeremyah and I am working on a java project to > interface with some devices. In short, I have a laptop with a PCMIA > converter that does RS422 running windows 2000. I also will be > installing some PCI cards into some Linux boxes that will have probably > 4-8 RS422 ports on them. After doing some reading in order to talk with > these items using my existing java code I will need an additional > driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > trying to get a map sort of where I need to make changes. As I see it, I > would need to subclass SerialPort to my RS422 interface. That would link > with a DLL or SO implementation that talks with the hardware. I also > need to change the listing of working ports in the lookup section for > serial. Does this seem like I am on the right track? Appreciate the > support. > Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi@qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 20:40:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue Jun 21 21:11:30 2005 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618954@emss02m08.us.lmco.com> I'd like to except I am dealing with NASA. I am basically building a system to monitor 100+ Units that communicate over RS422. They have some converters in place but want to get rid of them. I'll check through the archives. I had started looking yesterday as was leaving work. -----Original Message----- From: rxtx-bounces@mail.electronpusher.org [mailto:rxtx-bounces@mail.electronpusher.org]On Behalf Of Ricardo Trindade Sent: Tuesday, June 21, 2005 2:25 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx@mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > _______________________________________________ Rxtx mailing list Rxtx@mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From slavelle at atcorp.com Tue Jun 21 21:58:06 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue Jun 21 21:56:49 2005 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: <42B87F5E.4000403@atcorp.com> > Linux has the standard POSIX like baud rates but if you set the baud rate > to B38400, you can set your own baud base and divisor. This is not POSIX > that I know of. W32 has more capability than POSIX like systems too. So > I did some work to have windows work like Linux via termios.c > > But the code is not quit right. SerialImp.c and termios.c need some > work so all the various buadrates work on Linux and W32. Most other > systems will not work beyond what CommAPI already specifies without > writting kernel drivers. > > This is on my todo list but if someone gets to it first, all the better. Hmm, I guess I didn't read this close enough before. Just to be clear, the pieces to setBaudBase and setDivisor are not yet implemented, correct? Thanks, Shawn From sean_montgomery at baseview.com Tue Jun 21 22:14:08 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue Jun 21 22:13:00 2005 Subject: [Rxtx] OS X installation - file locations Message-ID: <8AB82C7F-0D19-45F9-AE54-A12C59A8495E@baseview.com> Greetings, I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) using the RXTX installation instructions. RXTX worked fine. Basically you've got: - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions - javax.comm.properties in /System/Library/Frameworks/ JavaVM.framework/Home/lib - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ lib/ext My coworker was concerned that the installation required files to be placed in /System/Library... because those directories are "Apple's" and subject to change at Apple's whim, and that it would be safer (less likely to break when a user updates their OS or Java version or what have you) if all the files could be somewhere in /Library... or / Library/Java. My coworker points out that when 3rd party apps like FrontBase and JBoss need to communicate with Java their jars are placed in /Library/Java/Extensions. Granted that RXTX 2.0 is implementing javax.comm and not just a 3rd party extension, might that be the case - that javax.* stuff needs to be in the Java system files? I'm not the Java maven that my coworker is, so I don't know if any of this is gospel or not. Any OS X/Java experts out there willing to comment? We'd like to be able to install RXTX in the safest, most maintenance free way possible, but if there are specific reasons why javax.comm.properties and comm.jar need to be in /System... then so be it. Any information is welcome, Sean From ricardo.trindade at emation.pt Tue Jun 21 22:56:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Jun 21 22:55:43 2005 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B88D25.7060604@emation.pt> An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050621/f6c9f5fe/attachment.htm From jeremyah.l.payne at lmco.com Tue Jun 21 22:22:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue Jun 21 22:57:06 2005 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618955@emss02m08.us.lmco.com> -----Original Message----- From: rxtx-bounces@mail.electronpusher.org [mailto:rxtx-bounces@mail.electronpusher.org]On Behalf Of Trent Jarvi Sent: Tuesday, June 21, 2005 2:40 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 As of yet we have not decided on the PCI boards to use yet So I am still waiting to se how we will interface to them. But the laptop is ready to use so ill build a test app for that API for now. The overview of class structure is really what I needed. I guess I will use the 2.1 as you suggested. Thanks for the help thus far! BTW, you guys wouldn't happen to keep class diagrams or anything of that nature around would you? If not I will probably end up having to do some anyway for documentation purposes, I could include them. Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi@qbang.org _______________________________________________ Rxtx mailing list Rxtx@mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From dmarkman at mac.com Wed Jun 22 01:13:28 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Wed Jun 22 01:12:44 2005 Subject: [Rxtx] OS X installation - file locations In-Reply-To: References: Message-ID: <044F520C-585C-4B99-82ED-3BA83DB8CE77@mac.com> Apple doesn't recommend to put jars into the /System/Library/Frameworks/JavaVM.framework/Home/lib/ext folder from other hands it's standard java directory to put extentions if you want to support comm api on whole system then I'd recommend to put jars into the /Library/Java/Extensions folder just like you did if you want to support comm api per user put your jars into the ~/ Library/Java/Extensions On Jun 21, 2005, at 5:14 PM, Java RXTX discussion wrote: > Greetings, > > > I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) > using the RXTX installation instructions. RXTX worked fine. > > > Basically you've got: > - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions > - javax.comm.properties in /System/Library/Frameworks/ > JavaVM.framework/Home/lib > - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ > lib/ext > > > My coworker was concerned that the installation required files to be > placed in /System/Library... because those directories are "Apple's" > and subject to change at Apple's whim, and that it would be safer > (less likely to break when a user updates their OS or Java version or > what have you) if all the files could be somewhere in /Library... or / > Library/Java. My coworker points out that when 3rd party apps like > FrontBase and JBoss need to communicate with Java their jars are > placed in /Library/Java/Extensions. Granted that RXTX 2.0 is > implementing javax.comm and not just a 3rd party extension, might > that be the case - that javax.* stuff needs to be in the Java system > files? > > > I'm not the Java maven that my coworker is, so I don't know if any of > this is gospel or not. Any OS X/Java experts out there willing to > comment? We'd like to be able to install RXTX in the safest, most > maintenance free way possible, but if there are specific reasons why > javax.comm.properties and comm.jar need to be in /System... then so > be it. > > > Any information is welcome, > > > Sean > > > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Dmitry Markman Dmitry Markman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050621/beea65d0/attachment.htm From lyon at docjava.com Thu Jun 23 11:39:47 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu Jun 23 11:38:31 2005 Subject: [Rxtx] web start + RXTX = strange errors? Message-ID: On: Date: Tue, 21 Jun 2005 11:15:53 +0100 From: Jasmine Strong Writes: An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. ----------- I cannot duplicate your error. My version of Java is: java -version java version "1.4.2_05" Is yours the same? Trent: You wrote: passing -source 1.3 -target 1.3 to javac will compile classes without this problem. ----------- OK, I have updated the disto to work with jdk1.3: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Jasmine: Is this working any better? Thanks! - DL From handzisk at tkn.tu-berlin.de Fri Jun 24 09:37:14 2005 From: handzisk at tkn.tu-berlin.de (Vlado Handziski) Date: Fri Jun 24 09:35:56 2005 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace Message-ID: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Hi all, let me first express my compliments on the great work you have done with the RXTX library. We have been using the library for some time, and we are at a point where we want to make our code public. For legacy reasons, the code that the RXTX library is bundled with, uses the javax.comm namespace. We have been using the ChangePackage script to change the RXTX2.1 package from gnu.io into javax.comm. We need the independent implementation since we want to be able to directly access /dev/ttyUSBx ports in linux and the CommAPI versions are just not as stable. On the download page, there is a comment that this is in violation of sun's license. Can someone shed more light on this. I was not aware that you can protect the names of the java packages. Best regards, Vlado From ricardo.trindade at emation.pt Fri Jun 24 11:01:17 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri Jun 24 10:59:56 2005 Subject: [Rxtx] parity missed Message-ID: <42BBD9ED.3060004@emation.pt> Hi, I have a "parity missed error". From previous posts I believe this has to do with CMSPAR not being defined. I checked out 2.1 head from CVS. How can I make sure I do a proper build and CMSPAR is defined ? Perhaps it would be good to have a release snapshot that has this, I think the latest snapshot (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. Another question I have, is why must this depend on kernel headers, why can't it be defined in the RXTX source ? thanks Ricardo From jasmine at electronpusher.org Fri Jun 24 11:09:06 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri Jun 24 11:07:48 2005 Subject: [Rxtx] web start + RXTX = strange errors? In-Reply-To: References: Message-ID: <644aad2bdbba950f0a2fb12d7dcfd8a6@electronpusher.org> On 23 Jun 2005, at 11:39, Dr. Douglas Lyon wrote: > OK, I have updated the disto to work with jdk1.3: > http://show.docjava.com:8086/book/cgij/code/jnlp/ > addbk.JAddressBook.Main.jnlp > > Jasmine: Is this working any better? Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) -J. From taj at www.linux.org.uk Fri Jun 24 17:54:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 24 17:51:29 2005 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: On Fri, 24 Jun 2005, Vlado Handziski wrote: > Hi all, > > let me first express my compliments on the great work you have done with > the RXTX library. > > We have been using the library for some time, and we are at a point where > we want to make our code public. For legacy reasons, the code that the > RXTX library is bundled with, uses the javax.comm namespace. We have been > using the ChangePackage script to change the RXTX2.1 package from gnu.io > into javax.comm. We need the independent implementation since we want to > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > versions are just not as stable. > > On the download page, there is a comment that this is in violation of > sun's license. Can someone shed more light on this. I was not aware that > you can protect the names of the java packages. > > Best regards, > Vlado > I can't provide legal advice as I am not a lawyer. (v) may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are contained in the "java", "javax" or "sun" packages or similar as specified by Sun in any class file naming convention; and The license is in the commapi package from Sun. The above is also in all the EULA's you click through to download from Sun if I'm not mistaken. Simply put, the license taints developers that agree to it. For those developers, Sun has control of the javax.comm namespace. It really does not make sense to put rxtx 2.1 in the javax.comm namespace. It will only cause confusion which I think is the point of the clause above. The gnu.io namespace was perhaps a poor choice and just tossed in when reviewing the license to get out of Sun's namespace. There is nothing in the rxtx license limiting your freedom in this fashion though. Many companies are moving to gnu.io and some distribute it with popular applications you would recognize. I'm tempted to ask you not to contaminate rxtx 2.1 with the javax.comm namespace. You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) extensions to existing classes (which I dont think you are using); it is not just javax.comm. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Fri Jun 24 20:24:09 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 24 20:21:20 2005 Subject: [Rxtx] parity missed In-Reply-To: <42BBD9ED.3060004@emation.pt> References: <42BBD9ED.3060004@emation.pt> Message-ID: On Fri, 24 Jun 2005, Ricardo Trindade wrote: > Hi, > > I have a "parity missed error". From previous posts I believe this > has to do with CMSPAR not being defined. > I checked out 2.1 head from CVS. How can I make sure I do a proper > build and CMSPAR is defined ? Perhaps it would be good to have a release > snapshot that has this, I think the latest snapshot > (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. > > Another question I have, is why must this depend on kernel headers, > why can't it be defined in the RXTX source ? > I used to cheat and grab the CMSPAR from the kernel headers because glibc did not have it. Now rxtx uses the glibc headers and we have a patch in glibc I trust that handles this. It would not be right to override glibc and it wasnt right to use the kernel headers (it really did cause problems). You can override glibc for now with the following in the top of SerialImp.c # define CMSPAR 010000000000 You can check if your distro headers have this right bit looking for the above in bits/termios.h. It should look like this: #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif If it is not defined, please file a bug with your distro as rxtx is not the only thing that will be broken on that distro. I was going to release new cvs snapshots last weekend but got tied up. I'll do it this weekend. I also need to get custom baudrate patches into the cvs snapshot. -- Trent Jarvi tjarvi@qbang.org From ricardo.trindade at emation.pt Fri Jun 24 20:56:50 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri Jun 24 20:55:29 2005 Subject: [Rxtx] parity missed In-Reply-To: References: <42BBD9ED.3060004@emation.pt> Message-ID: <42BC6582.2070805@emation.pt> An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050624/e3b39631/attachment.htm From vlado.handziski at gmail.com Sat Jun 25 13:25:52 2005 From: vlado.handziski at gmail.com (Vlado Handziski) Date: Sat Jun 25 13:24:32 2005 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: <697986ec05062505256ebf381f@mail.gmail.com> Thanks for the clarification. Since changing the bundled source is not an option at this moment, we will consider using javax.comm and RXTX2.0. In the next rewrite, we would probably move to gnu.io . Best regards, Vlado Handziski On 6/24/05, Trent Jarvi wrote: > > On Fri, 24 Jun 2005, Vlado Handziski wrote: > > > Hi all, > > > > let me first express my compliments on the great work you have done with > > the RXTX library. > > > > We have been using the library for some time, and we are at a point > where > > we want to make our code public. For legacy reasons, the code that the > > RXTX library is bundled with, uses the javax.comm namespace. We have > been > > using the ChangePackage script to change the RXTX2.1 package from gnu.io > > into javax.comm. We need the independent implementation since we want to > > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > > versions are just not as stable. > > > > On the download page, there is a comment that this is in violation of > > sun's license. Can someone shed more light on this. I was not aware that > > you can protect the names of the java packages. > > > > Best regards, > > Vlado > > > > I can't provide legal advice as I am not a lawyer. > > (v) may not create, or authorize your licensees to create additional > classes, interfaces, or subpackages that are contained in the "java", > "javax" or "sun" packages or similar as specified by Sun in any class file > naming convention; and > > The license is in the commapi package from Sun. The above is also in all > the EULA's you click through to download from Sun if I'm not mistaken. > > Simply put, the license taints developers that agree to it. For those > developers, Sun has control of the javax.comm namespace. > > It really does not make sense to put rxtx 2.1 in the javax.comm namespace. > It will only cause confusion which I think is the point of the clause > above. The gnu.io namespace was perhaps a poor choice and > just tossed in > when reviewing the license to get out of Sun's namespace. > > There is nothing in the rxtx license limiting your freedom in this fashion > though. Many companies are moving to gnu.io and some > distribute it with > popular applications you would recognize. I'm tempted to ask you not > to contaminate rxtx 2.1 with the javax.comm namespace. > > You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm > using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) > extensions to existing classes (which I dont think you are using); it is > not just javax.comm. > > -- > Trent Jarvi > tjarvi@qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050625/1dadc50e/attachment.htm From taj at www.linux.org.uk Sun Jun 26 18:34:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun Jun 26 18:32:13 2005 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. Message-ID: The attached file should fix baud_base and divisor extensions for Linux The patch is against rxtx 2.1 CVS HEAD. To use this patch, you should set the baud rate to 38400. You can then try SerialPort.setBaudBase(int) and SerialPort.setDivisor(int) There are matching int SerialPort.getBaudBase() and int SerialPort.getDivisor(). What baud bases are available depends upon the serial port card and its driver so this is a bit of a blind attempt on my part. I've looked at the w32 API and I dont see anything available yet. The w32 code in RXTX will probably be figuring out the baud rate based on the tried baud base and divisor and just slamming it at the API for now (the API does something with that but I've not found real documentation on what it does). I dont want to try tinkering with the UART directly yet as that would involve poking machine memory directly and could very easily be error prone in bad ways. I don't expect Solaris or any SysV UNIX systems to work at all with this - ever. It is not standard in any way and will throw Exceptions on everything but Linux (w32 will just fail miserably as it is 1/2 implemented). If anyone has looked at custom baud rates before and has some thoughts or just wants to try the attached untested patch, I'd appreciate any feedback. -- Trent Jarvi tjarvi@qbang.org -------------- next part -------------- ? autom4te.cache ? build ? output cvs server: Diffing . Index: configure =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure,v retrieving revision 1.35.2.59 diff -u -r1.35.2.59 configure --- configure 16 Oct 2004 16:20:34 -0000 1.35.2.59 +++ configure 26 Jun 2005 16:59:28 -0000 @@ -9644,6 +9644,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { #if defined (__GLIBC__) @@ -9782,6 +9784,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { @@ -9825,7 +9829,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -9837,7 +9841,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 26 Jun 2005 16:59:28 -0000 @@ -218,6 +218,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { #if defined (__GLIBC__) @@ -356,6 +358,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { @@ -399,7 +403,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -411,7 +415,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" cvs server: Diffing CNI cvs server: Diffing MACOSX_IDE cvs server: Diffing MACOSX_IDE/CW cvs server: Diffing MACOSX_IDE/ForPackageMaker cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions cvs server: Diffing MACOSX_IDE/ForPackageMaker/Resources cvs server: Diffing MACOSX_IDE/PB cvs server: Diffing WinCE cvs server: Diffing contrib cvs server: Diffing debian cvs server: Diffing src Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 26 Jun 2005 16:59:29 -0000 @@ -2079,15 +2079,17 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int BaudBase The clock frequency divided by 16. Default * BaudBase is 115200. * @return boolean true on success - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:setBaudBase()"); @@ -2097,10 +2099,11 @@ /** * Extension to CommAPI * @return int BaudBase - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getBaudBase() throws UnsupportedCommOperationException + public int getBaudBase() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getBaudBase()"); @@ -2108,13 +2111,14 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, IOException { if ( debug ) z.reportln( "RXTXPort:setDivisor()"); @@ -2124,10 +2128,11 @@ /** * Extension to CommAPI * @returns int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getDivisor() throws UnsupportedCommOperationException + public int getDivisor() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getDivisor()"); Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 26 Jun 2005 16:59:30 -0000 @@ -1877,16 +1877,27 @@ int fd = get_java_var( env, jobj,"fd","I" ); struct serial_struct sstruct; + if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) + { + goto fail; + } + + sstruct.baud_base = (int) BaudBase; + if ( sstruct.baud_base < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetBaudBase", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetBaudBase", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1914,9 +1925,13 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) ( sstruct.baud_base ) ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetBaudBase", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetBaudBase", strerror( errno ) ); @@ -1950,19 +1965,23 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } if ( sstruct.custom_divisor < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetDivisor", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetDivisor", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1971,7 +1990,7 @@ accept: none perform: Find the Divisor used for custom speeds - return: Divisor + return: Divisor negative value on error. exceptions: Unsupported Comm Operation on systems not supporting TIOCGSERIAL comments: @@ -1990,10 +2009,14 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) sstruct.custom_divisor ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetDivisor", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetDivisor", strerror( errno ) ); @@ -2032,7 +2055,7 @@ /* Open and lock the port so nothing else changes the setting */ - if ( LOCK( filename, pid ) ) goto fail;; + if ( LOCK( filename, pid ) ) goto fail; fd = find_preopened_ports( filename ); if( !fd ) Index: src/SerialPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/Attic/SerialPort.java,v retrieving revision 1.3.2.9 diff -u -r1.3.2.9 SerialPort.java --- src/SerialPort.java 12 Oct 2004 08:59:28 -0000 1.3.2.9 +++ src/SerialPort.java 26 Jun 2005 16:59:30 -0000 @@ -103,13 +103,17 @@ public abstract String getUARTType() throws UnsupportedCommOperationException; public abstract boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getBaudBase() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getDivisor() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setLowLatency() throws UnsupportedCommOperationException; public abstract boolean getLowLatency() cvs server: Diffing src/lfd cvs server: Diffing src/psmisc From uwe at kubosch.no Mon Jun 27 21:13:57 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Mon Jun 27 21:12:33 2005 Subject: [Rxtx] RXTX on FC4 Message-ID: <1119903238.2989.27.camel@BPC0276> Hi all! I just got RXTX to work on Fedora Core 4. The standard download did not work. I had to check the code out from CVS and build it, but then it worked flawlessly. Thanks for your good work. Now I wonder if I should contribute the compiled files so that others will have an easier time than me getting RXTX to work on FC4. What do I do? Who do I talk to? donV From taj at www.linux.org.uk Mon Jun 27 21:29:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon Jun 27 21:26:57 2005 Subject: [Rxtx] RXTX on FC4 In-Reply-To: <1119903238.2989.27.camel@BPC0276> References: <1119903238.2989.27.camel@BPC0276> Message-ID: On Mon, 27 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I just got RXTX to work on Fedora Core 4. > > The standard download did not work. > > I had to check the code out from CVS and build it, but then it worked > flawlessly. > > Thanks for your good work. > > Now I wonder if I should contribute the compiled files so that others > will have an easier time than me getting RXTX to work on FC4. What do I > do? Who do I talk to? > > The best thing to do with FC is to contibute an extras RPM. Debian does something like this with their .deb packaging. As rxtx is OS neutral, it is almost impossible to have everything on rxtx.org. If you do get a package in Fedora Extras, I can point a link there. The extra's mail list is here: https://www.redhat.com/mailman/listinfo/fedora-extras-list If it would help to have me release a 'stable' .tar.gz of the source for the RPM submittal process I can do that. It would also trigger upgrades in debian which would not be bad. -- Trent Jarvi tjarvi@qbang.org From slavelle at atcorp.com Mon Jun 27 23:23:20 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon Jun 27 23:21:58 2005 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: Message-ID: <42C07C58.1030608@atcorp.com> Hey Trent, I installed it and now I get IOExceptions instead of the other one. I'm not sure how those changes would have enabled setDivisor and setBaudBase to work though. Is it significant that this is a USB device emulating a serial port? ~ Shawn From taj at www.linux.org.uk Tue Jun 28 01:07:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 28 01:05:02 2005 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: <42C07C58.1030608@atcorp.com> References: <42C07C58.1030608@atcorp.com> Message-ID: On Mon, 27 Jun 2005, Shawn Lavelle wrote: > Hey Trent, > I installed it and now I get IOExceptions instead of the other one. > I'm not sure how those changes would have enabled setDivisor and > setBaudBase to work though. Is it significant that this is a USB device > emulating a serial port? > The USB driver probably does not support this. With USB, the ioctl()'s appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through the linux drivers/usb tree and found to ioctl to support this in Linux 2.6.10. RXTX is not doing very much magic, the patch really only gets the serial struct instead of writing a structure with random values for baudbase and handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel level driver issue not a user space library issue. So if you wanted this to work, the usb serial driver would have to handle the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression after looking through the USB tree quickly. I hope that helps. -- Trent Jarvi tjarvi@qbang.org From lyon at docjava.com Tue Jun 28 01:25:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Jun 28 01:23:59 2005 Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) Message-ID: Hi All, I wrote: Jasmine: Is this working any better? And Jasmine says: Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) I am using -source 1.3 and -target 1.3 for the compilation, however, we still seem to have this problem, which my machine (for some reason) does not have. Does anyone have any ideas about what might be the problem? Thanks! - DL From taj at www.linux.org.uk Tue Jun 28 02:04:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 28 02:01:44 2005 Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) In-Reply-To: References: Message-ID: On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I wrote: > Jasmine: Is this working any better? > > And Jasmine says: > Nope. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > > I am using -source 1.3 and -target 1.3 > for the compilation, however, we still seem to have this problem, > which my machine (for some reason) does not have. > Does anyone have any ideas about what might be the problem? > This has shown up in the past with jdk 1.5 compiled jars running on jre 1.4 machines. My guess is either jasmine has an old copy of rxtx with the problem on her machine that is being picked up on the classpath or you have not tried this with jre 1.4. The suggested -source/target fix should avoid the problem. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Tue Jun 28 04:23:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 28 04:21:04 2005 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: On Tue, 28 Jun 2005, Trent Jarvi wrote: > On Mon, 27 Jun 2005, Shawn Lavelle wrote: > > > Hey Trent, > > I installed it and now I get IOExceptions instead of the other one. > > I'm not sure how those changes would have enabled setDivisor and > > setBaudBase to work though. Is it significant that this is a USB device > > emulating a serial port? > > > > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > > RXTX is not doing very much magic, the patch really only gets the serial > struct instead of writing a structure with random values for baudbase and > handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel > level driver issue not a user space library issue. > > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. > > I hope that helps. > > > It may be possible that you can just modify translate_speed and get_java_baudrate in SerialImp.c to have the new high speds you are after. The defines are in /usr/include/termios.h. #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 You can see many of these are not handled. I dont think CommAPI handled more than 57600 or so. int get_java_baudrate( int native_speed ) { switch( native_speed ) { case B0: return 0; case B50: return 50; case B75: return 75; case B110: return 110; case B134: return 134; case B150: return 150; case B200: return 200; case B300: return 300; case B600: return 600; case B1200: return 1200; case B1800: return 1800; case B2400: return 2400; case B4800: return 4800; case B9600: return 9600; case B19200: return 19200; case B38400: return 38400; case B57600: return 57600; default: return -1; } } int translate_speed( JNIEnv *env, jint speed ) { LEAVE( "RXTXPort:translate_speed" ); switch( speed ) { case 0: return B0; case 50: return B50; case 75: return B75; case 110: return B110; case 134: return B134; case 150: return B150; case 200: return B200; case 300: return B300; case 600: return B600; case 1200: return B1200; case 1800: return B1800; case 2400: return B2400; case 4800: return B4800; case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; #ifdef B57600 case 57600: return B57600; #endif /* B57600 */ #ifdef B115200 case 115200: return B115200; #endif /* B115200 */ #ifdef B230400 case 230400: return B230400; #endif /* B230400 */ #ifdef B460800 case 460800: return B460800; #endif /* B460800 */ #ifdef B14400 case 14400: return B14400; #endif /* B14400 */ #ifdef B28800 case 28800: return B28800; #endif /* B28800 */ #ifdef B128000 /* dima */ case 128000: return B128000; #endif /* dima */ #ifdef B256000 /* dima */ case 256000: return B256000; #endif /* dima */ } /* Handle custom speeds */ if( speed >= 0 ) return speed; else { LEAVE( "RXTXPort:translate_speed: Error condition" ); return -1; } } -- Trent Jarvi tjarvi@qbang.org From lyon at docjava.com Tue Jun 28 12:20:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Jun 28 12:20:18 2005 Subject: [Rxtx] cross-compilation using Make for Mac Message-ID: Hi All, Please excuse the long post; Trent said: >" >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. " Here is what I have on the mac version: java -version java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) When I run: http://show.docjava.com:8086/book/cgij/code/jnlp/math.benchmarks.Dhry.jnlp I get: -- listing properties -- jnlpx.heapsize=NULL,NULL jnlpx.splashport=-1 java.runtime.name=Java(TM) 2 Runtime Environment, Stand... java.protocol.handler.pkgs=com.sun.javaws.net.protocol sun.boot.library.path=/System/Library/Frameworks/JavaVM.fra... java.vm.version=1.4.2-38 awt.nativeDoubleBuffering=true gopherProxySet=false http.auth.serializeRequests=true java.vm.vendor="Apple Computer, Inc." java.vendor.url=http://apple.com/ path.separator=: java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io jnlpx.home=/Applications/Utilities/Java/Java Web... user.country=US sun.os.patch.level=unknown java.vm.specification.name=Java Virtual Machine Specification user.dir=/ java.runtime.version=1.4.2_05-141.4 java.awt.graphicsenv=apple.awt.CGraphicsEnvironment java.endorsed.dirs=/System/Library/Frameworks/JavaVM.fra... os.arch=ppc java.io.tmpdir=/tmp line.separator= java.vm.specification.vendor=Sun Microsystems Inc. jnlpx.remove=false os.name=Mac OS X sun.java2d.fontpath= java.library.path=/Applications/Utilities/Java/Java Web... java.specification.name=Java Platform API Specification java.class.version=48.0 jnlpx.deployment.user.home=/Users/lyon/Library/Caches/Java Web S... java.util.prefs.PreferencesFactory=java.util.prefs.MacOSXPreferencesFactory os.version=10.3.9 user.home=/Users/lyon user.timezone=America/New_York java.security.policy=file:/Applications/Utilities/Java/Jav... java.awt.printerjob=apple.awt.CPrinterJob trustProxy=true java.specification.version=1.4 file.encoding=MacRoman jnlpx.deployment.system.home=/Applications/Utilities/Java/J2SE 5.0... user.name=lyon java.class.path=/Applications/Utilities/Java/Java Web... java.vm.specification.version=1.0 sun.arch.data.model=32 java.home=/System/Library/Frameworks/JavaVM.fra... java.specification.vendor=Sun Microsystems Inc. user.language=en awt.toolkit=apple.awt.CToolkit java.vm.info=mixed mode java.version=1.4.2_05 java.ext.dirs=/Users/lyon/Library/Java/Extensions:/... sun.boot.class.path=/System/Library/Frameworks/JavaVM.fra... java.vendor=Apple Computer, Inc. file.separator=/ java.vendor.url.bug=http://developer.apple.com/java/ sun.cpu.endian=big sun.io.unicode.encoding=UnicodeBig mrj.version=141.3 jnlpx.jvm=/System/Library/Frameworks/JavaVM.fra... sun.cpu.isalist= sun.awt.exception.handler=apple.awt.CToolkit$EventQueueExceptio... javawebstart.version=javaws-1.4.2_05 800 mhz g4,878k ds/sec total time: 1184ms Result: 844594 dhrystone/sec. Load average for last 15 minutes:0.62 So, I feel pretty sure that I have tried this with 1.4. As to modifying the RXTX compilation, that I did not do...and I take your point. I have been using the binary distributions as is. Oops. I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Now when I do a make, I get: make gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known libtool: link: warning: undefined symbols not allowed in i386-pc-mingw32 shared libraries rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ln: `SerialImp.o': File exists make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 So, I do a make clean, then a make: .... (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ar cru .libs/librxtxSerial.a /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o ar: /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o: No such file or directory make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 In the i386 directory, there is a symbolic link left from something: ls -al SerialImp.o lrwxrwxrwx 1 lyon lyon 12 Jun 28 07:03 SerialImp.o -> SerialImp.lo However, the SerialImp.lo is not present (which is the cause of the error, I think). On the other hand, the file I am looking for is present in: i686-pc-linux-gnu Possibly the i386 generation is not clean (of course it is also likely that I am just asking dumb questions, being a newbie to the code and all.). Finally, will this make file regenerate the distro for the mac? I found some really old (from year 2001) files in: cvs/MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions Which I could use for the distro...but I would prefer to do a clean, multi-platform build from make. Thanks! - Doug >On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > >> Hi All, >> I wrote: >> Jasmine: Is this working any better? >> >> And Jasmine says: >> Nope. >> >> An error occurred while launching/running the application. >> >> Title: addbk.JAddressBook.Main >> Vendor: DocJava, Inc. >> Category: Unexpected Error >> >> gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) >> >> > > I am using -source 1.3 and -target 1.3 >> for the compilation, however, we still seem to have this problem, >> which my machine (for some reason) does not have. >> Does anyone have any ideas about what might be the problem? >> > >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. > > >The suggested -source/target fix should avoid the problem. > >-- >Trent Jarvi >tjarvi@qbang.org From slavelle at atcorp.com Tue Jun 28 16:43:41 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue Jun 28 16:42:15 2005 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: <42C1702D.1070307@atcorp.com> > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. There is ioctl stuff in the driver for the chip, but i haven't seen the TIOC*SERIAL entries. That might be why it continues to fail. I did get around the problem, though, by hacking the driver and just specifying the baud rate I need. Now everything works well. Thanks for all the assistance you've provided. ~ Shawn M. Lavelle From taj at www.linux.org.uk Tue Jun 28 19:42:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 28 19:39:37 2005 Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known Add a compiler flag -DWIN32 The code above should not be compiling on w32 as it is #if !defined(WIN32) You can look at the bottom of Makefile.in to see the w32 compile flags. Search for "WIN32 CrossCompiling from here down" If its still not working, I can set you up with the Bob account. Just email me off the list. W32 compiling is a bit complicated. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Tue Jun 28 19:52:50 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 28 19:49:55 2005 Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Nods. I did change configure but right now it is only in the baudbase/divisor patch I posted. I'm going to add several extension baud rates that can be supported by normal API calls and commit that today as a followup to my comments yesterday on baudrates. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Wed Jun 29 08:52:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Jun 29 08:49:14 2005 Subject: [Rxtx] [PATCH] More baud rate fixes Message-ID: I went through the native baudrate conversion from Java and added several. This patch is against CVS 2.1 head. I think thats it for baud rate fixes unless someone see something. -- Trent Jarvi tjarvi@qbang.org -------------- next part -------------- A non-text attachment was scrubbed... Name: baud_base_and_divisor_plus_odd_baudrates.diff.gz Type: application/x-gzip Size: 3291 bytes Desc: Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050629/4c1ef1c2/baud_base_and_divisor_plus_odd_baudrates.diff.bin From lyon at docjava.com Wed Jun 29 17:33:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed Jun 29 17:32:24 2005 Subject: [Rxtx] java.comm dependencies Message-ID: Hi All, During a build of the rxtx code, I have left the javax.comm out of the system (on purpose). However, I get an error, at run time: CommPortIdentifier:static initialization() apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: javax/comm/CommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver I am thinking that there is something in the gnu.io.CommPortIdentifier that seeks to load the javax.comm.CommDriver. It was my understanding that we could write code without reference to the javax.comm.CommDriver and that we could work in the gnu namespace. Is this true? Thanks! - Doug From taj at www.linux.org.uk Wed Jun 29 18:16:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Jun 29 18:13:08 2005 Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > During a build of the rxtx code, I have left the > javax.comm out of the system (on purpose). > However, I get an error, at run time: > > CommPortIdentifier:static initialization() > apple.awt.EventQueueExceptionHandler Caught Throwable : > java.lang.NoClassDefFoundError: javax/comm/CommDriver > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > that seeks to load the javax.comm.CommDriver. > > It was my understanding that we could write code without reference > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > Is this true? > Yes. People use 2.1 without javax all the time. There should be no reference to javax at all in rxtx 2.1. You may check your code. I just did a grep through 2.1 and there is nothing. You may look at the classes you are using. If you find javax.comm in your code, replace it with gnu.io and that should be all you need to do. -- Trent Jarvi tjarvi@qbang.org From jayant28k at gmail.com Thu Jun 30 04:49:28 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Thu Jun 30 04:48:04 2005 Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: <6a6a02310506292049778c452f@mail.gmail.com> Trent, I think best idea is to have wiki for rxtx code. So as the traffic is increasing with time. "RXTX" seems to be more popular in embbeded system. Sun Microsystems will always apperciate your efforts on parallel and serial ports commincation based application in IT Industry. Thanks for your help on this forum as "ONE MAN ARMY" ;-) Cheers, Jayant On 6/29/05, Trent Jarvi wrote: > On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > > > Hi All, > > During a build of the rxtx code, I have left the > > javax.comm out of the system (on purpose). > > However, I get an error, at run time: > > > > CommPortIdentifier:static initialization() > > apple.awt.EventQueueExceptionHandler Caught Throwable : > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > > that seeks to load the javax.comm.CommDriver. > > > > It was my understanding that we could write code without reference > > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > > > Is this true? > > > > Yes. People use 2.1 without javax all the time. > > There should be no reference to javax at all in rxtx 2.1. You may check > your code. I just did a grep through 2.1 and there is nothing. You may > look at the classes you are using. > > If you find javax.comm in your code, replace it with gnu.io and that > should be all you need to do. > > > -- > Trent Jarvi > tjarvi@qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx@mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From uwe at kubosch.no Sat Jun 25 09:50:24 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Thu Jun 30 06:30:49 2005 Subject: [Rxtx] RXTX in FC3/FC4 Message-ID: <1119689424.12606.14.camel@BPC0276> Hi all! I am trying to get RXTX to work on Fedora Core, version 3 or 4. I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext directory. I have edited the jre/lib/javax.comm.properties according to the docs. I have tried this with both rxtx 2.0 and 2.1. I have tried on two different machines. I have tried with java 1.4.2 and java 1.5.0, both from Sun. I always get a signall 11 from the native libraries when they are loaded. Is this a common problem? Any help is greatly appreciated. Below is the start of the error message. More can be supplied on demand. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x65015A Function=(null)+0x65015A Library=/lib/ld-linux.so.2 NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) - locked <0xed46f628> (a java.util.Vector) - locked <0xed471708> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xed46ebc0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.InitializeDriver(CommPortIdentifier.java:213) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:248) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:351) at com.jpeterson.x10.module.CM11A.allocate(CM11A.java:1160) at net.sourceforge.cruisecontrol.publishers.X10Publisher.send(X10Publisher.java:182) at net.sourceforge.cruisecontrol.publishers.X10Publisher.turnOff(X10Publisher.java:171) at net.sourceforge.cruisecontrol.publishers.X10Publisher.handleBuild(X10Publisher.java:148) at net.sourceforge.cruisecontrol.publishers.X10Publisher.publish(X10Publisher.java:141) at net.sourceforge.cruisecontrol.Project.publish(Project.java:679) at net.sourceforge.cruisecontrol.Project.build(Project.java:227) at net.sourceforge.cruisecontrol.Project.execute(Project.java:153) at net.sourceforge.cruisecontrol.ProjectWrapper.run(ProjectWrapper.java:66) at java.lang.Thread.run(Thread.java:534) From chris_jh at blueyonder.co.uk Tue Jun 28 12:37:10 2005 From: chris_jh at blueyonder.co.uk (Christopher Harris) Date: Thu Jun 30 06:31:02 2005 Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError Message-ID: <42C13666.9030108@blueyonder.co.uk> Hi I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 32bit) The serial ports work fine with no issues, but when i try to use the parallel port i get this message Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:66) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) I am trying to print a line out to port "/dev/lp0" At first i thought it could not find the librxtxParallel.so file, but when i renamed it i got a different saying it could not find the library. I have tried to run as root no difference. It is really weird, i get no compile errors and the serial ports work fine. I changed the LPRPort.java and commented out the Initialize call method. And just get the same error but for the method open. It is as though it can't see the methods, and yet it can see the library. I did have a bit of check of the JNI implementation in rxtx but could not spot anything. Yours Thankfully Christopher Harris From lyon at docjava.com Thu Jun 30 09:28:09 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu Jun 30 09:26:43 2005 Subject: [Rxtx] tools Message-ID: Hi All, I have been thinking about automatic cross-platform native method development of Java/C programs. It appears that different binary tools are needed to target different platforms. Configuration seems a bit painful. Is there something better available than make? Is ANT any good at this? Has anyone tried: http://jnipp.sourceforge.net/ Thanks! - Doug From lyon at docjava.com Thu Jun 30 11:11:17 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu Jun 30 11:09:55 2005 Subject: [Rxtx] javax.comm Message-ID: Hi All, When I load my jar files on a linux box, all is well. However, when I load them on a mac, I get: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver The jar files for the mac are different from the jar files for linux, because recompilation of the native code for the mac has not been easy, for me. As a result, the RXTX jars are tending toward specific versions and platforms. Probably, this is not an ideal situation, but, I suspect, it is common. I have an idea that we could create a single JNLP distro site that we can make reference to that would enable a uniform repository of synchronized signed native methods and jars for RXTX. For example, the one-wire Maxim folks have a real-nice approach where their stuff makes reference to another JNLP file that contains all the stuff we need to make RXTX work. Check it out at: http://www.maxim-ic.com/products/ibutton/software/1wire/OneWireViewer.cfm However, even they have problems on an unconfigured machine: Specified adapter name "DS9097U" is not known * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cannot load default adapter. Please check that the adapter is connected and that no other application is using the port. If you have checked the adapter, the default port might not be selected. Either set the value of the TMEX default using the utility provided with the TMEX Runtime, or create a new file in the /lib folder called onewireviewer.properties with two lines, similar to the following: #native win32 drivers adapter.name={DS9097U} adapter.port=COM1 #or javax.comm drivers adapter.name=DS9097U adapter.port=COM1 The full path to this file should be: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/onewireviewer.properties ---- Wow, that is a show stopper! Configuration is something that we really need to think about as an automatic thing, particularly for web start users. You can't ask a person who wants to run an application to figure out how to alter a properties file. If you know you need one, then get permission and make one...automatically. That makes a lot of sense, to me. Basically, we need an installer. At the very least, all the pre-built binaries and jars needed for the RXTX package on several platforms should be available from a single place. One this happens, we can make a JNLP file that is platform specific, but can give us a level of indirection. Is this something that has been done already? Thanks! - Doug From taj at www.linux.org.uk Thu Jun 30 15:10:22 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu Jun 30 15:07:21 2005 Subject: [Rxtx] tools In-Reply-To: References: Message-ID: On Thu, 30 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I have been thinking about automatic cross-platform > native method development of Java/C programs. > > It appears that different binary tools are needed to target different > platforms. Configuration seems a bit painful. > > Is there something better available than make? > > Is ANT any good at this? I'm far from an Ant expert but have used it for other projects. The main problem I see with ant is there is no mainstream support for platform neutral neutral library creation as far as I can tell. I think ant is a fine replacement for make but I've not seen a suitable replacement for autoconf. At that point, make is as good as anything. It should be possible to create a ant build.xml that works on say Solaris, Linux, Windows and Mac OS X. The problem is when you are trying to build a library for embeded ARM from Mac OS X. > Has anyone tried: > http://jnipp.sourceforge.net/ -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Thu Jun 30 21:22:02 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu Jun 30 21:19:01 2005 Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <1119689424.12606.14.camel@BPC0276> References: <1119689424.12606.14.camel@BPC0276> Message-ID: On Sat, 25 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I am trying to get RXTX to work on Fedora Core, version 3 or 4. > > I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 > directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext > directory. > > I have edited the jre/lib/javax.comm.properties according to the docs. > > I have tried this with both rxtx 2.0 and 2.1. > > I have tried on two different machines. > > I have tried with java 1.4.2 and java 1.5.0, both from Sun. > > I always get a signall 11 from the native libraries when they are > loaded. Is this a common problem? Any help is greatly appreciated. > Below is the start of the error message. More can be supplied on > demand. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x65015A > Function=(null)+0x65015A > Library=/lib/ld-linux.so.2 > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) If you compile rxtx from source, this will probably go away. I'm not sure what the exact cause is but it looks like the binaries are not suitable for FC3/4. The ABI may have changed since those had been compiled. -- Trent Jarvi tjarvi@qbang.org From taj at www.linux.org.uk Thu Jun 30 21:26:56 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu Jun 30 21:23:56 2005 Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError In-Reply-To: <42C13666.9030108@blueyonder.co.uk> References: <42C13666.9030108@blueyonder.co.uk> Message-ID: tOn Tue, 28 Jun 2005, Christopher Harris wrote: > Hi > > I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 > 32bit) > > The serial ports work fine with no issues, but when i try to use the > parallel port i get this message > > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:66) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) > > > I am trying to print a line out to port "/dev/lp0" > > At first i thought it could not find the librxtxParallel.so file, but > when i renamed it i got a different saying it could not find the library. > > I have tried to run as root no difference. > > It is really weird, i get no compile errors and the serial ports work fine. > > I changed the LPRPort.java and commented out the Initialize call method. > And just get the same error but for the method open. > > It is as though it can't see the methods, and yet it can see the library. > I did have a bit of check of the JNI implementation in rxtx but could > not spot anything. > > > You can check if the symbols are in the shared library: nm librxtxSerial.so |grep Initialize If the symbols are not there, there was a build error. Watch very close for build errors while compiling from source. I suspect something isnt behaving right. -- Trent Jarvi tjarvi@qbang.org From allen at adbyrne.us Thu Jun 30 13:55:58 2005 From: allen at adbyrne.us (Allen Byrne) Date: Tue Jul 5 18:27:59 2005 Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> References: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> Message-ID: <200506300755.59159.allen@adbyrne.us> On Thursday 30 June 2005 00:31, rxtx-request@mail.electronpusher.org wrote: > >Message: 8 >Date: Sat, 25 Jun 2005 10:50:24 +0200 >From: Uwe Kubosch >Subject: [Rxtx] RXTX in FC3/FC4 >To: rxtx@mail.electronpusher.org >Message-ID: <1119689424.12606.14.camel@BPC0276> >Content-Type: text/plain > >Hi all! > >I am trying to get RXTX to work on Fedora Core, version 3 or 4. > >I have tried this with both rxtx 2.0 and 2.1. > >I have tried on two different machines. > >I have tried with java 1.4.2 and java 1.5.0, both from Sun. > >I always get a signall 11 from the native libraries when they are >loaded. ?Is this a common problem? ?Any help is greatly appreciated. >Below is the start of the error message. ?More can be supplied on >demand. > >An unexpected exception has been detected in native code outside the VM. >Unexpected Signal : 11 occurred at PC=0x65015A >Function=(null)+0x65015A >Library=/lib/ld-linux.so.2 > I had thi same problem on SUSE9.3 and java 1.5.0. After searching through the archives, I found a patch that required adding a sleep(1000) command in two functions of SerialIO.java. This only was for rxtx2.1, I had no trouble with rxtx2.0. Note, also I had to add the "|1.5*" sequence to the configure.in file to get good *.so libs. Again 2.0 was fine. -- Allen Byrne adbyrne@ieee.org http://modelrr.adbyrne.us From taj at www.linux.org.uk Fri Jun 3 01:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 08:57:29 +0100 (BST) Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 3 09:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 16:57:53 +0100 (BST) Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi at qbang.org From jasmine at electronpusher.org Fri Jun 3 10:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 17:12:21 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 11:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:02:09 +0100 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 11:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:05:10 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From jon.nall at gmail.com Mon Jun 6 09:13:58 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 10:13:58 -0500 Subject: [Rxtx] StackOverflowError Message-ID: I have a fairly small application that is communicating to a microcontroller programmer at 115.2k. I have a test where I try and dump the memory of the microcontroller (whose size is 8k and change). Things are going smoothly and the data looks good. Then after reading out ~6.5k of data, I get a StackOverflowError. The stack trace looks like: CommInterface.serialEvent(): 324 // this is my code RXTXPort.sendEvent(): 732 RXTXPort.eventLoop() [Native] MonitorThread.run(): 1531 I am running on windows and using rxtx-2.1-CVS-20050120. When I increased the stack size to 512k, I could read the entire chip without issue. But that doesn't seem like the right thing to do without root causing what's happening. My code doesn't include any recursion and the stack trace looks terribly short, so I'm a bit confused as to why I'm getting a StackOverflowError. CommInterface.serialEvent() does little more than grab the available bytes, enter a synchronized block, stick them in a common data area for the main thread to use and leave the synchronization block. I guess my question is: are there any known issues with the default stack size when using the latest rxtx on windows? thanks, nall. From taj at www.linux.org.uk Mon Jun 6 09:27:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 16:27:34 +0100 (BST) Subject: [Rxtx] StackOverflowError In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > I have a fairly small application that is communicating to a > microcontroller programmer at 115.2k. I have a test where I try and > dump the memory of the microcontroller (whose size is 8k and change). > Things are going smoothly and the data looks good. Then after reading > out ~6.5k of data, I get a StackOverflowError. The stack trace looks > like: > > CommInterface.serialEvent(): 324 // this is my code > RXTXPort.sendEvent(): 732 > RXTXPort.eventLoop() [Native] > MonitorThread.run(): 1531 > > I am running on windows and using rxtx-2.1-CVS-20050120. When I > increased the stack size to 512k, I could read the entire chip without > issue. But that doesn't seem like the right thing to do without root > causing what's happening. My code doesn't include any recursion and > the stack trace looks terribly short, so I'm a bit confused as to why > I'm getting a StackOverflowError. > > CommInterface.serialEvent() does little more than grab the available > bytes, enter a synchronized block, stick them in a common data area > for the main thread to use and leave the synchronization block. > > I guess my question is: are there any known issues with the default > stack size when using the latest rxtx on windows? > This is the first I've heard of the problem. It is strange as you mention lookin at the stack trace. That cant be taking up too much space. If you just toss the data instead of trying to put it in your work area, does it persist? -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Mon Jun 6 10:09:39 2005 From: lengyel at gmail.com (FL) Date: Mon, 6 Jun 2005 12:09:39 -0400 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on which the jdk1.5.0_03 is installed. I found that the INSTALL documentation seems to be in error. It states that javacomm20-x86.tar.Z (the Java Communications API for Solaris/x86) must be used, in fact this choice led to the following test with theBlackBox sample program in the commapi: root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG BlackBox -p /dev/ttyS0 Port /dev/ttyS0 not found! No serial ports found! Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to cause Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to the Eclipse stable build version 3.1M7 to avoid this. However, I found that using the Solaris/Sparc version of commapi worked on my system. I have documented this on: http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050606/b28fb9a7/attachment-0395.html From taj at www.linux.org.uk Mon Jun 6 10:30:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:30:27 +0100 (BST) Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, FL wrote: > I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on > which the jdk1.5.0_03 is installed. I found that the INSTALL documentation > seems to be in error. It states that javacomm20-x86.tar.Z (the Java > Communications API for Solaris/x86) must be used, in fact this choice led to > the following test with theBlackBox sample program in the commapi: > > root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG > BlackBox -p /dev/ttyS0 > Port /dev/ttyS0 not found! > No serial ports found! > > Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to > cause > Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to > the Eclipse stable build version 3.1M7 to avoid this. > > However, I found that using the Solaris/Sparc version of commapi > worked on my system. > > I have documented this on: > > http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 > Thanks FL. I'll change the documentation to point to the SPARC comm.jar. In the past, any Solaris was good enough, we tried to avoid the w32 comm.jar because it made native calls rxtx would never implement on any OS as they are not platform neutral. I'll withold comments about Sun's comm.jar being different on various CPUs within even the same OS. RXTX 2.1 does not need to do that even acrossed OSs for instance. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 6 10:35:43 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 11:35:43 -0500 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API Message-ID: It seems that Sun's javax.comm site does not include JavaDoc'ed API and the RxTx site has the API, but no real documentation. Is there some site that i'm just missing in my google searches? I'm looking for a copy of the javax.comm API which is documented. Thanks, nall. From taj at www.linux.org.uk Mon Jun 6 10:44:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:44:03 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > It seems that Sun's javax.comm site does not include JavaDoc'ed API > and the RxTx site has the API, but no real documentation. Is there > some site that i'm just missing in my google searches? I'm looking for > a copy of the javax.comm API which is documented. > > Thanks, > nall. Sun's version is with their binary downloads. RXTX tries to match that so I never bothered with more complete JavaDocs. Whatever Sun documents is what we try to do. -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Mon Jun 6 12:13:44 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 6 Jun 2005 14:13:44 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: Message-ID: <20050606181245.528C929D56F@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Trent Jarvi > Sent: Monday, June 06, 2005 12:44 PM > To: Jon Nall; Java RXTX discussion > Subject: Re: [Rxtx] Where can I find JavaDoc on the javax.comm API > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > It seems that Sun's javax.comm site does not include JavaDoc'ed API > > and the RxTx site has the API, but no real documentation. Is there > > some site that i'm just missing in my google searches? I'm > looking for > > a copy of the javax.comm API which is documented. > > > > Thanks, > > nall. > > Sun's version is with their binary downloads. RXTX tries to > match that so I never bothered with more complete JavaDocs. > Whatever Sun documents is what we try to do. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Try http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht ml -Ack From gadelavega at yahoo.com.ar Mon Jun 6 12:58:09 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Mon, 6 Jun 2005 15:58:09 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606181245.528C929D56F@mail.electronpusher.org> Message-ID: <20050606185809.57069.qmail@web14603.mail.yahoo.com> --- "David S. Acker" escribi?: > > -----Original Message----- > > From: rxtx-bounces at mail.electronpusher.org > > [mailto:rxtx-bounces at mail.electronpusher.org] On > Behalf Of Trent Jarvi > > Sent: Monday, June 06, 2005 12:44 PM > > To: Jon Nall; Java RXTX discussion > > Subject: Re: [Rxtx] Where can I find JavaDoc on > the javax.comm API > > > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > > > It seems that Sun's javax.comm site does not > include JavaDoc'ed API > > > and the RxTx site has the API, but no real > documentation. Is there > > > some site that i'm just missing in my google > searches? I'm > > looking for > > > a copy of the javax.comm API which is > documented. > > > > > > Thanks, > > > nall. > > > > Sun's version is with their binary downloads. > RXTX tries to > > match that so I never bothered with more complete > JavaDocs. > > Whatever Sun documents is what we try to do. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > Try > http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > ml > -Ack > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > I'm prety sure it was there... but not anymore. Gonzalo A. de la Vega, BI ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From taj at www.linux.org.uk Mon Jun 6 18:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 01:09:14 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606185809.57069.qmail@web14603.mail.yahoo.com> References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: >> http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > > I'm prety sure it was there... but not anymore. > It is there. Maybe the URL got mangled. Try this http://tinyurl.com/8dfp7 It just redirects you to: http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.html -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 7 05:46:39 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Jun 2005 07:46:39 -0400 Subject: [Rxtx] rxtx under fedora - odd procedures Message-ID: Hi All, I was able to get RXTX communications to work under Fedora, but only after I added myself to the UUCP and LOCK groups, logged out and then logged back in. Both groups appear to be needed in order to access the serial ports. Also the group alter did not take until after I logged out and logged back in. My theory is that you need permission to write to the var/spool directory under fedora and that this is the only way to do it. Logging out and logging back in just seems like an odd thing to do. I suppose some users may have to restart X. Ouch! Is this true? The alter_group command indicates that you need to be an su to alter the group database. Does this mean that my serial port users need a database su able person to use serial port applications under RXTX? If so, what is the procedure to make a transparent install work using Java web start? Should I be prompting users for the su password? Should I be telling users to exit from X and log out? Is this the way other serial communications programs work? Thanks! - Doug From sean_montgomery at baseview.com Tue Jun 7 08:14:51 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 7 Jun 2005 10:14:51 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: >>> http://java.sun.com/products/javacomm/javadocs/javax/comm/package- >>> summary.ht >>> > > >> >> I'm prety sure it was there... but not anymore. >> >> > > It is there. Maybe the URL got mangled. Try this > > http://tinyurl.com/8dfp7 > > It just redirects you to: > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > summary.html > Maybe the issue here is that the info is available without frames from that URL, but when you try to access it with frames (from the link on that page) it doesn't work - it takes you to: http://java.sun.com/products/javacomm/javadocs/index.html Which doesn't have anything useful on it. From gadelavega at yahoo.com.ar Tue Jun 7 08:22:50 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:22:50 -0300 (ART) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: Message-ID: <20050607142251.92850.qmail@web14626.mail.yahoo.com> --- "Dr. Douglas Lyon" escribi?: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the > group > alter did not take until after I logged out and > logged back in. > > My theory is that you need permission to write to > the var/spool > directory under fedora and that this is the only way > to do it. > > Logging out and logging back in just seems like an > odd thing to > do. I suppose some users may have to restart X. > Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port > applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log > out? > Is this the way other serial communications programs > work? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Actually, you need the lock group to acces /var/lock directory, and uucp to acces /dev/ttyS*. You (as root) shuold add all users you will allow to use the serial ports to group uucp and all the ones you'll allow to lock the ports to lock group (rxtx needs both). This is not only for rxtx, but for any use of the serial ports. Next time they login they'll be able to work, so if they are in they'll have to log out first. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From gadelavega at yahoo.com.ar Tue Jun 7 08:23:56 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:23:56 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> Message-ID: <20050607142356.93815.qmail@web14624.mail.yahoo.com> --- Sean Montgomery escribi?: > > On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: > > >>> > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > >>> summary.ht > >>> > > > > > >> > >> I'm prety sure it was there... but not anymore. > >> > >> > > > > It is there. Maybe the URL got mangled. Try this > > > > http://tinyurl.com/8dfp7 > > > > It just redirects you to: > > > > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > > summary.html > > > > Maybe the issue here is that the info is available > without frames > from that URL, but when you try to access it with > frames (from the > link on that page) it doesn't work - it takes you > to: > > http://java.sun.com/products/javacomm/javadocs/index.html > > Which doesn't have anything useful on it. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > That's right, my bad. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From jon.nall at gmail.com Tue Jun 7 08:33:40 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 09:33:40 -0500 Subject: [Rxtx] performance expectations Message-ID: Hi all. I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC microcontroller. The protocol I'm using (which I didn't create) looks like this for the section of code I'm concerned with: PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data PIC -> PC: 0x01 // ACK 0xNN // First 8 bits of data 0xMM // Second 8 bits of data I issue ~2000 of these Read commands. The PIC itself has an input fifo which can store 18 bytes, so I can have 18 read commands in flight at a given time. The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k 8N1. I am measuring the time it takes to perform these 2000 commands at around 30 seconds, which is much longer than I anticipated. With the link fully utilized, I expected: Time per byte transmitted: 115200 / 8 = 14400 bytes/second = ~70 uS/byte Time per response transmitted: ~70 uS/byte * 3 bytes/response = ~210 uS/response Time for 2000 responses to be transmitted: ~210 uS/response * 2000 responses = ~420ms I'm a bit new to this, so I may have made some bad asumptions, but I would have expected a time of a couple of seconds to perform the 2000 reads, not 30+ seconds. I'm obviously missing something here. Can someone help me understand what's going on? Thanks, nall. From taj at www.linux.org.uk Tue Jun 7 09:17:48 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:17:48 +0100 (BST) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the group > alter did not take until after I logged out and logged back in. > > My theory is that you need permission to write to the var/spool > directory under fedora and that this is the only way to do it. > > Logging out and logging back in just seems like an odd thing to > do. I suppose some users may have to restart X. Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log out? > Is this the way other serial communications programs work? > RIght now, rxtx requires you do one of two things. 1) Use lock files (recommended). This requires intervention by the root users to allow users to create lock files and open the ports as you note. 2) configure rxtx with --disable-lockfiles. In this case you need only worry about the permissions on /dev/ttyS* I'm not sure what the default on Fedora is with respect to permisions. This is not very attractive. There is a better way it could be done on Fedora. Fedora comes with lockdev library. I've been considering this for some time. We could use that for the locking and do away with many of the problems. The problem is embeded devices running Linux do not come with liblockdev. But for your use, I would consider adding a new option for locking serial devices using liblockdev. lockdev-devel has a man page with further information. SYNOPSIS #include pid_t dev_testlock( const char * devname); pid_t dev_lock( const char * devname); pid_t dev_relock( const char * devname, pid_t pid); pid_t dev_unlock( const char * devname, pid_t pid); cc [ flag ... ] file ... -llockdev [ library ] This would probably need to be a configure time option to prevent problems on embeded Linux devices but could otherwise be the default on Linux. I could toss a quick patch together if this is confusing. It is actually easier than what rxtx does now. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 09:27:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:27:11 +0100 (BST) Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > Hi all. > I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC > microcontroller. The protocol I'm using (which I didn't create) looks like this > for the section of code I'm concerned with: > > PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data > PIC -> PC: 0x01 // ACK > 0xNN // First 8 bits of data > 0xMM // Second 8 bits of data > > I issue ~2000 of these Read commands. The PIC itself has an input fifo which > can store 18 bytes, so I can have 18 read commands in flight at a given time. > The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k > 8N1. > > I am measuring the time it takes to perform these 2000 commands at around 30 > seconds, which is much longer than I anticipated. With the link fully utilized, > I expected: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte > > Time per response transmitted: > ~70 uS/byte * 3 bytes/response = ~210 uS/response > > Time for 2000 responses to be transmitted: > ~210 uS/response * 2000 responses = ~420ms > > I'm a bit new to this, so I may have made some bad asumptions, but I would have > expected a time of a couple of seconds to perform the 2000 reads, not 30+ > seconds. > > I'm obviously missing something here. Can someone help me understand what's > going on? > I've hooked rxtx in loopback with a scope in the past at 9600 baud (baud rate is not important). Using event notification and just writing a byte on event/read the latencey was around 8-12 ms. The JNI is not an efficient way to use native code - especially for bit banging. So if timing is critical you want to move some of the logic into the native code rather than banging over the JNI. 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your performance. C# has advantages here. If you move your logic into the native layer or use gcj (rxtx will work with that too) most of your latency should vanish. You may have to play with some sleeps in eventLoop at that point to get full native efficiency. With gcj all of rxtx becomes 'native code' as java is just treated as a subset of C++. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 09:38:51 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 10:38:51 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: On 6/7/05, Jon Nall wrote: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte of course that should be divided by 10 to account for the start/stop bits, but it barely changes the end results. From carobizar at free.fr Tue Jun 7 10:21:29 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 7 Jun 2005 18:21:29 +0200 Subject: [Rxtx] (no subject) Message-ID: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Hello ! I am a french student and I have to create an application able to read and write on serial and parallel port and to run on Windows and Linux. For the moment my program run on Windows thanks the Java Communication API (version for Microsoft Windows and Solaris/x86). But it doesn't work on Linux. Does a recent version of an installation documentation exist ? I didn't find one on the RXTX site (nothing for the windows installation and the linux installation deals with a "jcl.jar" that I don't know...). So, I have some questions : 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 version or Linux&w32 version ?) What are the differences between them ? Which of them are the most stable ? 2) Where have I to put the .so and .dll files ? 3) What have I to write on the file javax.comm.properties ? 4) Have I to delete the file win32comm.dll included in the Java Comm API ? 5) Have I to keep both comm.jar and RXTXcomm.jar ? Best regards, Caroline. From debief at telemsa.com Tue Jun 7 10:44:56 2005 From: debief at telemsa.com (DEBIEF Eric) Date: Tue, 7 Jun 2005 18:44:56 +0200 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: <200506071844.56656.debief@telemsa.com> Hi, We are "pushing" RxTx /Java here in a half-duplex link. The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC and application handling) about 25?s/byte. The figures are the barely the same on two environments. Environment 1 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Linux 2.6.3, Mdk 10.0. RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : bytes are lost on the wire. I need to investigate this mystery.... Java : 1.4.2-rc1 Blackdown Environment 2 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Windows 2000 Pro RxTx : 2.0.7. Java : 1.4.2_08 SUN I Hope this help, Eric. _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 7 11:05:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:05:45 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, DEBIEF Eric wrote: > Hi, > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. How many write() calls is this? > > Environment 1 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Linux 2.6.3, Mdk 10.0. > RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : > bytes are lost on the wire. I need to investigate this mystery.... > Java : 1.4.2-rc1 Blackdown > > Environment 2 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Windows 2000 Pro > RxTx : 2.0.7. > Java : 1.4.2_08 SUN > In my event/read/write test I found windows was ~20% faster than linux for some reason (strange part is Windows was in VMWare on the same Linux machine). It was about the same rxtx version. There are many problems with rxtx 1.4 with respect to commapi on windows but its code paths are more simple. What some people want from rxtx is perhaps better served by hacking up the very first release as they just want to read and write which is what rxtx was before Sun released commapi. It sounds like perhaps you are pushing out larger writes which will greatly improve results. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 11:16:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:16:49 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118161289.42a5c989cf6a2@imp4-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: On Tue, 7 Jun 2005 carobizar at free.fr wrote: > > Hello ! > > I am a french student and I have to create an application able to read and write > on serial and parallel port and to run on Windows and Linux. > For the moment my program run on Windows thanks the Java Communication API > (version for Microsoft Windows and Solaris/x86). > But it doesn't work on Linux. > > Does a recent version of an installation documentation exist ? > I didn't find one on the RXTX site (nothing for the windows installation and the > linux installation deals with a "jcl.jar" that I don't know...). > > So, I have some questions : > > 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 > version or Linux&w32 version ?) What are the differences between them ? Which > of them are the most stable ? > Use rxtx 2.0 with commapi for sparc solaris from Sun. If you want your current package javax.comm. > 2) Where have I to put the .so and .dll files ? On Linux just use the source, the configure script will do all of that for you. tar -xzvf rxtx-2.0-version mkdir rxtx-2.0-version/build cd rxtx-2.0-version/build ../configure && make install It will do everything for you. With Windows, you need to create the javax.comm.properties and install the DLL on your path. But you can just use Sun's package too. They are intended to be interchangable. > > 3) What have I to write on the file javax.comm.properties ? Driver=gnu.io.RXTXCommDriver More documentation in INSTALL that comes with the source. Sun's documentation should work too. configure does this for you on Linux. > > 4) Have I to delete the file win32comm.dll included in the Java Comm API ? > No > 5) Have I to keep both comm.jar and RXTXcomm.jar ? > Yes. RXTX 2.1 replaces comm.jar but the package is different (gnu.io) to avoid contaminating Sun's namespace. With rxtx 2.0 you need Sun's comm.jar - they work together. > > Best regards, > Caroline. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Tue Jun 7 12:07:34 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 14:07:34 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 Message-ID: <20050607180632.1543A29D5C8@mail.electronpusher.org> Hello, I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our product includes a built in USB to Serial adapter so that when it is connected to your PC over USB, it appears as a serial port. We had problems with Sun's comm library because it did not detect serial ports coming and going properly. I did run into a few issues with RxTx though. I am building under Windows (we support XP and 2000) under cygwin. I used a simple make file for the c code that works under cygwin and ant to build the java stuff. Attached is a diff file. The patches hit the following issues: ParallelImp.c - I am not using config so there is no config.h for me. Also, gcc didn't like a local file (win32termios.h) getting included with <> . RXTXPort.java - You can get an exception during the writeByte, writeArray, nativeDrain, readByte, read, readArray, readTerminatedArray, and nativeAvailable calls. Without this patch the IOLocked count gets stuck incremented. termios.c - If you try to open a port through CreateFile and get ERROR_ACCESS_DENIED it means someone else is using the port. We need to make sure to use serial_close instead of just close. I found that some devices finish their I/O synchronously. The code was treating this as an error. I also added some checking on the ClearError calls. I found a compile error when debugging is turned on (see the usleep change). SerialImp.c - Again, I don't have a config.h and again we must use quotes and not <> to include win32termios.h . I also commented out a report call since it seems to happen constantly on my system. Feel free to use these in any way that you want or just to ignore them. Thanks! -Dave Acker dacker at nomadio.net Software Engineer Nomadio, Inc. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diffs.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/5671d159/diffs-0392.txt From jon.nall at gmail.com Tue Jun 7 12:28:16 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 13:28:16 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, DEBIEF Eric wrote: > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. Hi. This is helpful, thanks. I can think of 2 reasons I'm not collecting the data as fast as I think I should be: 1) the device to PC connection is not at 100% utilization 2) my SerialPortEventListener processing has too much overhead Are there other explanations I might be missing as to why it takes so long to transfer the data? Thanks. nall. From taj at www.linux.org.uk Tue Jun 7 13:21:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:21:46 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > On 6/7/05, DEBIEF Eric wrote: > > We are "pushing" RxTx /Java here in a half-duplex link. > > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > > and application handling) about 25?s/byte. > > The figures are the barely the same on two environments. > > Hi. > This is helpful, thanks. I can think of 2 reasons I'm not collecting > the data as fast as I think I should be: > 1) the device to PC connection is not at 100% utilization > 2) my SerialPortEventListener processing has too much overhead > > Are there other explanations I might be missing as to why it takes so > long to transfer the data? > Polling the port would probably make more sense. You can set the threshold/timeouts to avoid racing and not deal with the event notification. As mentioned earlier I think the event latency is ~10ms. Keep the event listener around, rxtx 2.* does not close well without it. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 13:27:27 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 14:27:27 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, Trent Jarvi wrote: > Polling the port would probably make more sense. You can set the > threshold/timeouts to avoid racing and not deal with the event > notification. As mentioned earlier I think the event latency is ~10ms. Trent, Thanks for the response. Just to make sure I understand what you're talking about, when you say event latency, do you mean the time it takes from when the byte hits the PC's comm port to when rxtx presents it to user code? So if the link is 100% utilized, will my user code see "hiccups" or a steady stream of data? Thanks for helping a serial port newbie. nall. From dacker at nomadio.net Tue Jun 7 13:32:20 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 15:32:20 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <20050607193118.5499329CAA0@mail.electronpusher.org> Some folks asked about the make file and ant steps. I have JAVA_HOME set as follows: $ echo $JAVA_HOME C:\Program Files\Java\jdk1.5.0_01 I have all the code in rxtx/src put into gnu/io . The make file here doesn't have optimizations turned on. We have not tested with it yet. --------------Begin Makefile------------------ CPPFLAGS="-I$(JAVA_HOME)/include" "-I$(JAVA_HOME)/include/win32" SOBJECTS=SerialImp.o fuserImp.o termios.o fixup.o init.o POBJECTS=ParallelImp.o termios.o init.o DLLS=rxtxParallel.dll rxtxSerial.dll all: $(CLASSES) $(DLLS) rxtxSerial.dll: $(SOBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(SOBJECTS) rxtxParallel.dll: $(POBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(POBJECTS) clean: rm -fv $(SOBJECTS) $(POBJECTS) $(DLLS) %.o: %.c gcc -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< %.o: %.cpp g++ -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< --------------End Makefile------------------ Here is the ant target I use to build the rxtx libs. Our build puts the class files in a bin dir. We copy the dlls to a deploy dir and to the build dir. Eclipse seems to like the dlls in the build dir. The deploy dir is used when we build our full package. --------------Begin Ant Section------------------ --------------End Ant Section------------------ > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > David S. Acker > Sent: Tuesday, June 07, 2005 2:08 PM > To: 'Java RXTX discussion' > Subject: [Rxtx] Patches to 2.1-7pre17 > > Hello, > I am using RxTx with the Nomadio Sensor, > http://www.nomadio.net/ . Our product includes a built in > USB to Serial adapter so that when it is connected to your PC > over USB, it appears as a serial port. We had problems with > Sun's comm library because it did not detect serial ports > coming and going properly. > > I did run into a few issues with RxTx though. I am building > under Windows (we support XP and 2000) under cygwin. I used > a simple make file for the c code that works under cygwin and > ant to build the java stuff. Attached is a diff file. The > patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h > for me. Also, gcc didn't like a local file (win32termios.h) > getting included with <> . > > RXTXPort.java - You can get an exception during the > writeByte, writeArray, nativeDrain, readByte, read, > readArray, readTerminatedArray, and nativeAvailable calls. > Without this patch the IOLocked count gets stuck incremented. > > termios.c - If you try to open a port through CreateFile and > get ERROR_ACCESS_DENIED it means someone else is using the > port. We need to make sure to use serial_close instead of > just close. I found that some devices finish their I/O > synchronously. The code was treating this as an error. I > also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we > must use quotes and not <> to include win32termios.h . I > also commented out a report call since it seems to happen > constantly on my system. > > Feel free to use these in any way that you want or just to > ignore them. > Thanks! > > -Dave Acker > dacker at nomadio.net > Software Engineer > Nomadio, Inc. > From taj at www.linux.org.uk Tue Jun 7 13:37:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:37:45 +0100 (BST) Subject: [Rxtx] Re: Stack Smashing Attack In-Reply-To: <200506072012.48860.ferdinand.tatzig@web.de> References: <200506072012.48860.ferdinand.tatzig@web.de> Message-ID: On Tue, 7 Jun 2005, Ferdinand Tatzig wrote: > Dear Trent > > I am using RXTX for serial port communication between a PC and a payment > transaction terminal. > When I run my application under Windows 2000, an i386-Linux or an i386-FreeBSD > it works as I expect it to do. However, when I start it to run on AMD64 > machine with a 64-bit Gentoo Linux, the VM terminates with the following > error: > > Port found: /dev/ttyS0 > java: stack smashing attack in function configure_port() > > I am using a 64-bit Blackdown-1.4.2-01 VM. > > I have searched the internet but have found no information about this error. > > This is the code of the method which initializes the serial port: > > /** > * initializes a serial port for communication with a terminal; only > * accessible within this class > * > * @param communication > * @param serialPortToBeInitialized > * @param tillInterfaceEventListener > */ > private TillInterfaceSerialPort(Communication communication, > String serialPortToBeInitialized, > TillInterfaceEventListener tillInterfaceEventListener) > throws IOException, PortInUseException, > TillInterfaceSerialPortNotFoundException, > TooManyListenersException, UnsupportedCommOperationException { > serialPortName = "not initialized yet"; > CommPortIdentifier portId = null; > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > boolean portFound = false; > String temporarySerialPortName = "not initialized yet"; > > // look for a serial port > while (portList.hasMoreElements() && !portFound) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > temporarySerialPortName = portId.getName(); > if (temporarySerialPortName.equals(serialPortToBeInitialized)) { > System.out.print("Port found: "); > System.out.println(temporarySerialPortName); > serialPortName = temporarySerialPortName; > portFound = true; > } > } > } > if (portFound) { > > // initialize the found port - this command causes the VM to terminate > serialPort = (SerialPort) portId > .open( > TillInterfaceConstants.APPLICATION_NAME, > TillInterfaceConstants > .TIMEOUT_IN_MILLISECONDS_FOR_OPENING_OF_COMMUNICATION_PORT); > > // add an event listener which listens > // on the serial port and notifies the > // serial port object when input bytes > // have been received at the port > serialPort.addEventListener(tillInterfaceEventListener); > serialPort.notifyOnDataAvailable(true); > > // initialize the physical layer > // parameters of the serial port > serialPort.setSerialPortParams(TillInterfaceConstants.BAUD_RATE, > SerialPort.DATABITS_8, SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > // set the inter-character > // timeout (T2) > serialPort > .enableReceiveTimeout(TillInterfaceConstants.INTERCHARACTER_TIMEOUT_IN_MILLISECONDS); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > } else > throw new TillInterfaceSerialPortNotFoundException(); > } > > Any hint to solve this problem would be kindly appreciated. > The only thing that comes to mind here after looking at the offending function is rxtx used to include asm/termios.h but now we moved to termios.h and had glibc fix their headers. The asm/termios.h caused problems as its termios was smaller than the actual termios. This should be fixed in current rxtx versions but you can just glance at SerialImp.c and make sure it does not include asm/termios.h. I've cc'd the rxtx mail list because there was one other mention of stack problems recently. I have used rxtx on opteron systems with success. I have a bug I'm trying hard to reproduce on suse 64 bit (circa linux 2.4.19) systems though. So far I have not been able to reproduce the bug. That said, with gentoo... I like gentoo but I seriously doubt they do any QA with their kernel and Java. I've seen problems before. If you use gentoo and have Java problems, at least stick to Linus (that is an s there) kernels while using Java. I'm not an expert on gentoo but I've seen patches go into experimental kernels that turn out to break java and are reverted before going to Linus just before I see problems with gentoo on this list. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:16:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:16:14 +0100 (BST) Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: On Tue, 7 Jun 2005, David S. Acker wrote: > Hello, > I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our > product includes a built in USB to Serial adapter so that when it is > connected to your PC over USB, it appears as a serial port. We had problems > with Sun's comm library because it did not detect serial ports coming and > going properly. > > I did run into a few issues with RxTx though. I am building under Windows > (we support XP and 2000) under cygwin. I used a simple make file for the c > code that works under cygwin and ant to build the java stuff. Attached is a > diff file. The patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h for me. Also, > gcc didn't like a local file (win32termios.h) getting included with <> . > > RXTXPort.java - You can get an exception during the writeByte, writeArray, > nativeDrain, readByte, read, readArray, readTerminatedArray, and > nativeAvailable calls. Without this patch the IOLocked count gets stuck > incremented. > > termios.c - If you try to open a port through CreateFile and get > ERROR_ACCESS_DENIED it means someone else is using the port. We need to > make sure to use serial_close instead of just close. I found that some > devices finish their I/O synchronously. The code was treating this as an > error. I also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we must use quotes > and not <> to include win32termios.h . I also commented out a report call > since it seems to happen constantly on my system. > > Feel free to use these in any way that you want or just to ignore them. > Thanks! > Hi Dave These patches look great as is. Thanks. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:33:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:33:16 +0100 (BST) Subject: [Rxtx] Patch to IOLocked (fwd) Message-ID: This appears to be another solution to the locking. Chris, the other option just moves the locking into the finally clause which I think would be a little cleaner though I'm posting this patch to so people can comment. -- Trent Jarvi tjarvi at qbang.org ---------- Forwarded message ---------- Date: Wed, 1 Jun 2005 13:01:32 +0100 From: Christopher Dawes To: taj at www.linux.org.uk Subject: Patch to IOLocked Do you want me to check it out of CVS and then submit changes? Christopher -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXPort.java.diff Type: application/octet-stream Size: 6965 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/c442f9fc/RXTXPort.java-0395.obj From Christopher.Dawes at retail-logic.com Wed Jun 8 00:57:24 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 8 Jun 2005 07:57:24 +0100 Subject: [Rxtx] Patch to IOLocked (fwd) [Virus Checked] In-Reply-To: Message-ID: Agreed, much better Java :-) Thanks Christopher ------------------------------------------- Consultant Engineer Retail Logic Limited Fleet GU51 3TZ Tel: +44 (0)1252 644377 Mob: +44 (0)7899 842759 Fax: +44 (0)1252 776708 rxtx-bounces at mail.electronpusher.org wrote on 07/06/2005 21:33:16: > > This appears to be another solution to the locking. Chris, the other > option just moves the locking into the finally clause which I think would > be a little cleaner though I'm posting this patch to so people can > comment. > > -- > Trent Jarvi > tjarvi at qbang.org > > ---------- Forwarded message ---------- > Date: Wed, 1 Jun 2005 13:01:32 +0100 > From: Christopher Dawes > To: taj at www.linux.org.uk > Subject: Patch to IOLocked > > Do you want me to check it out of CVS and then submit changes? > > Christopher[attachment "RXTXPort.java.diff" deleted by Chris > Dawes/Retaillogic/NISABA] _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx From zempftman at gmail.com Wed Jun 8 07:57:25 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 09:57:25 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Maxwell Zempftman Date: May 27, 2005 5:01 PM Subject: Re: [Rxtx] Kaffe & rxtx & armv5b To: rxtx at mail.linuxgrrls.org Here are the results from working this week: The "NullPointerExceptions" are generated by the software when I choose a bad device file. I discovered that this occurs on the i686-RedHat box as well. This exception seems to be generated only by this particular application, and not by the example programs in contrib. So, for example: java MyApp /dev/null <-- generates NullPointerException java MyApp fake <-- generates NullPointerException java MyApp /dev/ttyS0 <-- does not generate NullPointerException Using the program CommCheck (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it appears as though /dev/ttyS0 is the only valid serial device file on the XScale device, so the errors I was getting are not really be bugs. Although /dev/ttyS0 did not generate NullPointerExceptions, I did encounter this error: --start java MyApp /dev/ttyS0 (going mostly from memory, not exact) PortList.hasMoreElements: true Listening on: /dev/ttyS0 Client connected. >From net: echo kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 vmExcept_setJNIFrame Assert: on 'fp != 0' failed. --end I took a look at exception.h, and it seems as though the problematic code does not exist in newer versions of Kaffe (I have been using CVS-2004-11). Next week I will try to use a newer version, although so far everything but CVS-2004-11 has failed. Also, I the device files I need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with something like this? Thanks, Max. > On 5/21/05, Trent Jarvi wrote: > > I'm not sure what is wrong in the first part. It sounds like your > > application may be swallowing an exception while trying to enumerate the > > port or open it. The usual mistake made it not having permissions to > > either open the port or create the lockfile. There should be examples in > > the contrib directory you can try that enumerate and open ports. Maybe > > that will give you some hints. > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > Sun's code limiting you there though you do need to compile and install > > rxtx for the XScale with Sun's Commapi. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > From taj at www.linux.org.uk Wed Jun 8 08:22:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 15:22:44 +0100 (BST) Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > ---------- Forwarded message ---------- > From: Maxwell Zempftman > Date: May 27, 2005 5:01 PM > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > To: rxtx at mail.linuxgrrls.org > > > Here are the results from working this week: > > The "NullPointerExceptions" are generated by the software when I > choose a bad device file. I discovered that this occurs on the > i686-RedHat box as well. This exception seems to be generated only by > this particular application, and not by the example programs in > contrib. So, for example: > > java MyApp /dev/null <-- generates NullPointerException > java MyApp fake <-- generates NullPointerException > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > Using the program CommCheck > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > appears as though /dev/ttyS0 is the only valid serial device file on > the XScale device, so the errors I was getting are not really be bugs. > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > encounter this error: > > --start > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > PortList.hasMoreElements: true > Listening on: /dev/ttyS0 > Client connected. > >From net: echo > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > --end > > I took a look at exception.h, and it seems as though the problematic > code does not exist in newer versions of Kaffe (I have been using > CVS-2004-11). Next week I will try to use a newer version, although so > far everything but CVS-2004-11 has failed. Also, I the device files I > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > something like this? > In RXTXCommDriver, just look for the following code and add /dev/ttyM to the list. Moxa? if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } So: if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyM", // for Moxa ports "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } Linux just has way too many port types to try enumerating them all. There is potential we can add them back in with udev now. > Thanks, > Max. > > > On 5/21/05, Trent Jarvi wrote: > > > I'm not sure what is wrong in the first part. It sounds like your > > > application may be swallowing an exception while trying to enumerate the > > > port or open it. The usual mistake made it not having permissions to > > > either open the port or create the lockfile. There should be examples in > > > the contrib directory you can try that enumerate and open ports. Maybe > > > that will give you some hints. > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > Sun's code limiting you there though you do need to compile and install > > > rxtx for the XScale with Sun's Commapi. > > > > > > -- > > > Trent Jarvi > > > tjarvi at qbang.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Wed Jun 8 12:16:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 08 Jun 2005 13:16:03 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A60B8D.8080500@cs.umn.edu> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> Message-ID: <42A735E3.8040706@atcorp.com> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual serial comport. This isn't so much of a problem, what is, however, is that the comport does not appear to be able to be set to any arbitrary speed, only those from the data_rate enum. I've not found much on using different speeds, has anyone else encountered anything similar? I greatly appreciate any and all comments and suggestions. Thanks in advance, ~ Shawn Lavelle From zempftman at gmail.com Wed Jun 8 12:50:58 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 14:50:58 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: Thanks Trent! That will solve one of the problems. I don't know when my next chance to work on it will be, but I still need to figure out the error I got when I tried opening '/dev/ttyS0' on the Moxa device regarding a failed assertion, seemed to be a Kaffe issue. Thanks for you help, hope to have results soon, Max Englander. On 6/8/05, Trent Jarvi wrote: > On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > > > ---------- Forwarded message ---------- > > From: Maxwell Zempftman > > Date: May 27, 2005 5:01 PM > > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > > To: rxtx at mail.linuxgrrls.org > > > > > > Here are the results from working this week: > > > > The "NullPointerExceptions" are generated by the software when I > > choose a bad device file. I discovered that this occurs on the > > i686-RedHat box as well. This exception seems to be generated only by > > this particular application, and not by the example programs in > > contrib. So, for example: > > > > java MyApp /dev/null <-- generates NullPointerException > > java MyApp fake <-- generates NullPointerException > > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > > > Using the program CommCheck > > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > > appears as though /dev/ttyS0 is the only valid serial device file on > > the XScale device, so the errors I was getting are not really be bugs. > > > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > > encounter this error: > > > > --start > > > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > > > PortList.hasMoreElements: true > > Listening on: /dev/ttyS0 > > Client connected. > > >From net: echo > > > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > > > --end > > > > I took a look at exception.h, and it seems as though the problematic > > code does not exist in newer versions of Kaffe (I have been using > > CVS-2004-11). Next week I will try to use a newer version, although so > > far everything but CVS-2004-11 has failed. Also, I the device files I > > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > > something like this? > > > > > In RXTXCommDriver, just look for the following code and add /dev/ttyM to > the list. Moxa? > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > So: > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyM", // for Moxa ports > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > Linux just has way too many port types to try enumerating them all. There > is potential we can add them back in with udev now. > > > > > Thanks, > > Max. > > > > > On 5/21/05, Trent Jarvi wrote: > > > > I'm not sure what is wrong in the first part. It sounds like your > > > > application may be swallowing an exception while trying to enumerate the > > > > port or open it. The usual mistake made it not having permissions to > > > > either open the port or create the lockfile. There should be examples in > > > > the contrib directory you can try that enumerate and open ports. Maybe > > > > that will give you some hints. > > > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > > Sun's code limiting you there though you do need to compile and install > > > > rxtx for the XScale with Sun's Commapi. > > > > > > > > -- > > > > Trent Jarvi > > > > tjarvi at qbang.org > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- > Trent Jarvi > tjarvi at qbang.org > From taj at www.linux.org.uk Wed Jun 8 12:53:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 19:53:10 +0100 (BST) Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A735E3.8040706@atcorp.com> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: On Wed, 8 Jun 2005, Shawn Lavelle wrote: > Hello, > I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate > with a virtual serial comport. This isn't so much of a problem, what > is, however, is that the comport does not appear to be able to be set to > any arbitrary speed, only those from the data_rate enum. I've not found > much on using different speeds, has anyone else encountered anything > similar? I greatly appreciate any and all comments and suggestions. > This problem is a bit more tricky than it should be. POSIX systems just have a few specified baud rates. Solaris is one of these systems. CommAPI baud rates probably came from someone looking at Solaris. RXTX tries to be POSIX like. W32 is treated as a POSIX like system via a termios.c file in rxtx. Serial ports have baudbase and divisor. So you can set these to come close to the baudrate you want. Some funky equipment like automobile test equipment use baud rates that are not really possible with PC hardware. But if you get as close as possible by changing baud base and divisor, it works. Windows can actually do this for you. I don't know exactly what their code does but if you pass a baudrate to windows, it will guestimate a baudbase and divisor. So you just pass it 10200 baud and it does its job. This is not of very much use the way rxtx does things though. Linux has the standard POSIX like baud rates but if you set the baud rate to B38400, you can set your own baud base and divisor. This is not POSIX that I know of. W32 has more capability than POSIX like systems too. So I did some work to have windows work like Linux via termios.c But the code is not quit right. SerialImp.c and termios.c need some work so all the various buadrates work on Linux and W32. Most other systems will not work beyond what CommAPI already specifies without writting kernel drivers. This is on my todo list but if someone gets to it first, all the better. -- Trent Jarvi tjarvi at qbang.org From carobizar at free.fr Thu Jun 9 06:39:10 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Thu, 9 Jun 2005 14:39:10 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: <1118320750.42a8386e6d3ce@imp5-q.free.fr> Hi ! Thank you for all your advices. I managed to use rxtx on Windows but I have still some difficulties on Linux. I have yet follow your instructions and the configure file has created : - librxtxSerial.so and librxtxParallel.so in the directory /usr/java/j2sdk1.4.2_08/jre/lib/i386 - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the directory /usr/java/j2sdk1.4.2_08/jre/lib - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext But when I run my program, Some exceptions occur : Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver So, 1) What have I forgotten ? 2) Is it possible to make my application run on Linux without the jdk (only the jre) ? Best regards, Caroline. From taj at www.linux.org.uk Thu Jun 9 07:28:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 9 Jun 2005 14:28:05 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118320750.42a8386e6d3ce@imp5-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: On Thu, 9 Jun 2005 carobizar at free.fr wrote: > Hi ! > Thank you for all your advices. > I managed to use rxtx on Windows but I have still some difficulties on Linux. > I have yet follow your instructions and the configure file has created : > - librxtxSerial.so and librxtxParallel.so in the directory > /usr/java/j2sdk1.4.2_08/jre/lib/i386 > - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the > directory /usr/java/j2sdk1.4.2_08/jre/lib > - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext > > But when I run my program, Some exceptions occur : > Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while > loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > com.sun.comm.SolarisDriver > > So, > 1) What have I forgotten ? > The native (.so) libraries are not installed in a directory the JRE is looking for native libraries in. You may look around and see where the .so libraries are in the JRE. I don't know that the jre/lib/i386 directory is specified as a required directory for JREs. I noticed some do not use it. You may try printing the java.libarary.path to see your options. It is also possible to alter the java.library.path. > 2) Is it possible to make my application run on Linux without the jdk (only the > jre) ? Yes. Though installation from source with the JDK is less error prone. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0392.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 7 15:03:09 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 07 Jun 2005 16:03:09 -0500 Subject: [Rxtx] Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <42A60B8D.8080500@cs.umn.edu> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual comport. This isn't so much of a problem, what is, however, is that the comport is only ever set to 9600 baud. I've not found this as a documented bug, has anyone else encountered anything similar? I'll try and provide more detail tomorrow, but if anyone has any suggestions or encountered this before, I'd like to hear about it. Thanks in advance, ~ Shawn Lavelle From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0395.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0395.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0395.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Mon Jun 20 01:04:40 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 20 Jun 2005 08:04:40 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: <42B66A88.4060806@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050620/9be208a1/attachment-0395.html From fbalzarro at libero.it Mon Jun 20 02:33:52 2005 From: fbalzarro at libero.it (Fabio Balzarro) Date: Mon, 20 Jun 2005 10:33:52 +0200 Subject: [Rxtx] RXTXPort:close detected bad file descriptor Message-ID: I'm using RXTX libraries on IPAQ 4150 PDA with Windows CE 4.20 and Jeode. When I close a serial port with sp.close() (where sp is a SerialPort) sometimes an error occour 1119256168085: RXTXPort:close detected bad file descriptor What can I do? Thanks Fabio ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From slavelle at atcorp.com Mon Jun 20 08:08:19 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 20 Jun 2005 09:08:19 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: <42B6CDD3.4040409@atcorp.com> It turns out that I did have a driver-not-used issue which has now been resolved and I can use RxTx on it (had to add ttyUSB as a valid port), but only at standard baud rates. Does USB have the same restrictions on port speed as regular RS232? ~ Shawn Trent Jarvi wrote: > Just a note here. > > I have requested a FTDI usb device and they offered to send one for the > purpose of trying to get rxtx working. I have no idea how long that takes > though. > > > On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > > >>I'm afraid we're just using the latest version from the FTDI website. I've >>not yet played with linux properly with this and unfortunately I run gentoo >>and haven't yet successfully compiled in the ftdi driver. I'll let you know >>if I get any success. >> >>Appologies >> >>Christopher >> >>-----Original Message----- >>From: rxtx-bounces at mail.electronpusher.org >>[mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle >>Sent: 15 June 2005 00:00 >>To: Java RXTX discussion >>Subject: Re: [Rxtx] Virtual Com Ports >> >>Hmm, the latter sounds like a lot of work. It does find the virtual comport >>in windows, i must have just missed it earlier (sign of a long day). On the >>linux side, I suspect that something is not correct with the driver >>installation becuase it does not give me a tty for it :( >> >>Christopher, May I ask what driver you are using for your FTDI chip? >>Did you ever encounter problems with not getting a tty assigned for it? >> >> >> Thanks for all your help! >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>They will have to show up as a tty device in Linux. Probably ttyUSB? >>>That will need an entry in RXTXCommDriver.java. If they dont show up >>>as a tty device, rxtx cant treat it like a serial port. It just wont >> >>work. >> >>>With COM3, rxtx will try to open the port and perform a timed out read. >>>Usually if a port is not there, the read blows up or the open blows up. >>>Timing out is fine. COM3 used to share interrupts with COM1. I know >>>you can reassign ports in XP. RXTX scans up through COM255. You may >>>try moving it. >>> >>> >>>The code in question is the following in RXTXCommDriver.java >>> >>> >>> if(osName.equals("Linux")) >>> { >>> String[] Temp = { >>> "ttyS", // linux Serial Ports >>> "ttySA", // for the IPAQs >>> "ttyUSB" // for USB frobs >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>> else if(osName.toLowerCase().indexOf("windows") != -1 ) >>> { >>> String[] Temp = { >>> "COM" // win32 serial ports >>> //"//./COM" // win32 serial ports >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>>If COM3 can be read, it should be found. the ttyUSB should work if >>>thats in the version of RXTXCommDriver.java you have. >>> >>>If this is still a problem, it may be that the driver is erroring on >>>what may be considered normal comm port operations such as setting the >>>speed, timeout, threshold, .. One would have to start looking at each >>>function called in the native open() and read(). >>> >>> >>> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>>seems to find the device using rxtx. Looking at the hardware >>>>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>>>linux. I can't seem to get it to show up as a tty(s#) in linux which >>>>is probably just due to my lack of significant linux knowledge. >>>> >>>> ~ Shawn >>>> >>>>Trent Jarvi wrote: >>>> >>>> >>>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>Has anyone here noticed that virtual comports do not get enumerated >>>>>>via CommPortIdentifier.getPortIdentifiers()?? >>>>>> >>>>>>The device I'm trying to talk to uses an fdti usb to serial >>>>>>convertor with a driver that has it show up as a virtual comport. I >>>>>>can enter this port manually and it will be usable but I cannot get >>>>>>it show up automatically (as in the simple serial demo). Any thoughts >> >>on this? >> >>>>> >>>>>Hi Shawn, >>>>> >>>>>What OS is this and what is the name of the virtual port you are >>>>>trying to open? I suspect the name just needs to be added to >> >>RXTXCommDriver.java. >> >>>>_______________________________________________ >>>>Rxtx mailing list >>>>Rxtx at mail.electronpusher.org >>>>http://www.electronpusher.org/mailman/listinfo/rxtx >>>> >>> >>> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From lyon at docjava.com Mon Jun 20 15:06:08 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 20 Jun 2005 17:06:08 -0400 Subject: [Rxtx] testing Message-ID: Hi All, I am testing my new multi-platform Java Webstart RXTX application (Trent: I could not have done it without you!). So far, I think it will work under Linux (x86), Windows XP, Windows 2000 and MacOS X. The application is available as a Java webstart application at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Edit:Preferences: SerialPort Setup... should bring up a dialog box that enables dialing via the modem. Generally, it does not find internal modems (except on the mac). Why, I don't know. Thanks in advance for trying this new app. All feedback on it is welcome. - Doug Lyon From jasmine at electronpusher.org Tue Jun 21 04:15:53 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Tue, 21 Jun 2005 11:15:53 +0100 Subject: [Rxtx] testing In-Reply-To: References: Message-ID: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > Hi All, > I am testing my new multi-platform Java Webstart RXTX application > (Trent: I could not have done it without you!). > > So far, I think it will work under Linux (x86), Windows XP, > Windows 2000 and MacOS X. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. -J. From taj at www.linux.org.uk Tue Jun 21 05:50:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 12:50:23 +0100 (BST) Subject: [Rxtx] testing In-Reply-To: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> References: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> Message-ID: On Tue, 21 Jun 2005, Jasmine Strong wrote: > > On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > > > Hi All, > > I am testing my new multi-platform Java Webstart RXTX application > > (Trent: I could not have done it without you!). > > > > So far, I think it will work under Linux (x86), Windows XP, > > Windows 2000 and MacOS X. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > on my Mac. > passing -source 1.3 -target 1.3 to javac will compile classes without this problem. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 10:19:25 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 11:19:25 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. Sincerely, Jeremyah Payne From ricardo.trindade at emation.pt Tue Jun 21 13:25:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 20:25:00 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B8698C.2060509@emation.pt> Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > From taj at www.linux.org.uk Tue Jun 21 13:39:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:39:43 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <42B8698C.2060509@emation.pt> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> <42B8698C.2060509@emation.pt> Message-ID: It looks like he has an rs422 device/converter. This is not the problematic 'trying to do protocol X with a serial port' situation unless I'm missing something. I'll follow up with the other email I started. On Tue, 21 Jun 2005, Ricardo Trindade wrote: > Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. > > Payne, Jeremyah L (N-CIM) wrote: > > >Good morning, my name is Jeremyah and I am working on a java project to > >interface with some devices. In short, I have a laptop with a PCMIA > >converter that does RS422 running windows 2000. I also will be > >installing some PCI cards into some Linux boxes that will have probably > >4-8 RS422 ports on them. After doing some reading in order to talk > >with these items using my existing java code I will need an additional > >driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > >trying to get a map sort of where I need to make changes. As I see it, > >I would need to subclass SerialPort to my RS422 interface. That would > >link with a DLL or SO implementation that talks with the hardware. I > >also need to change the listing of working ports in the lookup section > >for serial. Does this seem like I am on the right track? Appreciate > >the support. > > > > > >Sincerely, > >Jeremyah Payne > >_______________________________________________ > >Rxtx mailing list > >Rxtx at mail.electronpusher.org > >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 21 13:40:25 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:40:25 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: On Tue, 21 Jun 2005, Payne, Jeremyah L (N-CIM) wrote: > Good morning, my name is Jeremyah and I am working on a java project to > interface with some devices. In short, I have a laptop with a PCMIA > converter that does RS422 running windows 2000. I also will be > installing some PCI cards into some Linux boxes that will have probably > 4-8 RS422 ports on them. After doing some reading in order to talk with > these items using my existing java code I will need an additional > driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > trying to get a map sort of where I need to make changes. As I see it, I > would need to subclass SerialPort to my RS422 interface. That would link > with a DLL or SO implementation that talks with the hardware. I also > need to change the listing of working ports in the lookup section for > serial. Does this seem like I am on the right track? Appreciate the > support. > Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 13:40:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 14:40:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618954@emss02m08.us.lmco.com> I'd like to except I am dealing with NASA. I am basically building a system to monitor 100+ Units that communicate over RS422. They have some converters in place but want to get rid of them. I'll check through the archives. I had started looking yesterday as was leaving work. -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Ricardo Trindade Sent: Tuesday, June 21, 2005 2:25 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From slavelle at atcorp.com Tue Jun 21 14:58:06 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 21 Jun 2005 15:58:06 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: <42B87F5E.4000403@atcorp.com> > Linux has the standard POSIX like baud rates but if you set the baud rate > to B38400, you can set your own baud base and divisor. This is not POSIX > that I know of. W32 has more capability than POSIX like systems too. So > I did some work to have windows work like Linux via termios.c > > But the code is not quit right. SerialImp.c and termios.c need some > work so all the various buadrates work on Linux and W32. Most other > systems will not work beyond what CommAPI already specifies without > writting kernel drivers. > > This is on my todo list but if someone gets to it first, all the better. Hmm, I guess I didn't read this close enough before. Just to be clear, the pieces to setBaudBase and setDivisor are not yet implemented, correct? Thanks, Shawn From sean_montgomery at baseview.com Tue Jun 21 15:14:08 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 21 Jun 2005 17:14:08 -0400 Subject: [Rxtx] OS X installation - file locations Message-ID: <8AB82C7F-0D19-45F9-AE54-A12C59A8495E@baseview.com> Greetings, I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) using the RXTX installation instructions. RXTX worked fine. Basically you've got: - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions - javax.comm.properties in /System/Library/Frameworks/ JavaVM.framework/Home/lib - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ lib/ext My coworker was concerned that the installation required files to be placed in /System/Library... because those directories are "Apple's" and subject to change at Apple's whim, and that it would be safer (less likely to break when a user updates their OS or Java version or what have you) if all the files could be somewhere in /Library... or / Library/Java. My coworker points out that when 3rd party apps like FrontBase and JBoss need to communicate with Java their jars are placed in /Library/Java/Extensions. Granted that RXTX 2.0 is implementing javax.comm and not just a 3rd party extension, might that be the case - that javax.* stuff needs to be in the Java system files? I'm not the Java maven that my coworker is, so I don't know if any of this is gospel or not. Any OS X/Java experts out there willing to comment? We'd like to be able to install RXTX in the safest, most maintenance free way possible, but if there are specific reasons why javax.comm.properties and comm.jar need to be in /System... then so be it. Any information is welcome, Sean From ricardo.trindade at emation.pt Tue Jun 21 15:56:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 22:56:53 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B88D25.7060604@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050621/f6c9f5fe/attachment-0395.html From jeremyah.l.payne at lmco.com Tue Jun 21 15:22:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 16:22:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618955@emss02m08.us.lmco.com> -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Trent Jarvi Sent: Tuesday, June 21, 2005 2:40 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 As of yet we have not decided on the PCI boards to use yet So I am still waiting to se how we will interface to them. But the laptop is ready to use so ill build a test app for that API for now. The overview of class structure is really what I needed. I guess I will use the 2.1 as you suggested. Thanks for the help thus far! BTW, you guys wouldn't happen to keep class diagrams or anything of that nature around would you? If not I will probably end up having to do some anyway for documentation purposes, I could include them. Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From dmarkman at mac.com Tue Jun 21 18:13:28 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 21 Jun 2005 20:13:28 -0400 Subject: [Rxtx] OS X installation - file locations In-Reply-To: References: Message-ID: <044F520C-585C-4B99-82ED-3BA83DB8CE77@mac.com> Apple doesn't recommend to put jars into the /System/Library/Frameworks/JavaVM.framework/Home/lib/ext folder from other hands it's standard java directory to put extentions if you want to support comm api on whole system then I'd recommend to put jars into the /Library/Java/Extensions folder just like you did if you want to support comm api per user put your jars into the ~/ Library/Java/Extensions On Jun 21, 2005, at 5:14 PM, Java RXTX discussion wrote: > Greetings, > > > I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) > using the RXTX installation instructions. RXTX worked fine. > > > Basically you've got: > - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions > - javax.comm.properties in /System/Library/Frameworks/ > JavaVM.framework/Home/lib > - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ > lib/ext > > > My coworker was concerned that the installation required files to be > placed in /System/Library... because those directories are "Apple's" > and subject to change at Apple's whim, and that it would be safer > (less likely to break when a user updates their OS or Java version or > what have you) if all the files could be somewhere in /Library... or / > Library/Java. My coworker points out that when 3rd party apps like > FrontBase and JBoss need to communicate with Java their jars are > placed in /Library/Java/Extensions. Granted that RXTX 2.0 is > implementing javax.comm and not just a 3rd party extension, might > that be the case - that javax.* stuff needs to be in the Java system > files? > > > I'm not the Java maven that my coworker is, so I don't know if any of > this is gospel or not. Any OS X/Java experts out there willing to > comment? We'd like to be able to install RXTX in the safest, most > maintenance free way possible, but if there are specific reasons why > javax.comm.properties and comm.jar need to be in /System... then so > be it. > > > Any information is welcome, > > > Sean > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Dmitry Markman Dmitry Markman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050622/beea65d0/attachment-0395.html From lyon at docjava.com Thu Jun 23 04:39:47 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 23 Jun 2005 06:39:47 -0400 Subject: [Rxtx] web start + RXTX = strange errors? Message-ID: On: Date: Tue, 21 Jun 2005 11:15:53 +0100 From: Jasmine Strong Writes: An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. ----------- I cannot duplicate your error. My version of Java is: java -version java version "1.4.2_05" Is yours the same? Trent: You wrote: passing -source 1.3 -target 1.3 to javac will compile classes without this problem. ----------- OK, I have updated the disto to work with jdk1.3: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Jasmine: Is this working any better? Thanks! - DL From handzisk at tkn.tu-berlin.de Fri Jun 24 02:37:14 2005 From: handzisk at tkn.tu-berlin.de (Vlado Handziski) Date: Fri, 24 Jun 2005 10:37:14 +0200 (CEST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace Message-ID: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Hi all, let me first express my compliments on the great work you have done with the RXTX library. We have been using the library for some time, and we are at a point where we want to make our code public. For legacy reasons, the code that the RXTX library is bundled with, uses the javax.comm namespace. We have been using the ChangePackage script to change the RXTX2.1 package from gnu.io into javax.comm. We need the independent implementation since we want to be able to directly access /dev/ttyUSBx ports in linux and the CommAPI versions are just not as stable. On the download page, there is a comment that this is in violation of sun's license. Can someone shed more light on this. I was not aware that you can protect the names of the java packages. Best regards, Vlado From ricardo.trindade at emation.pt Fri Jun 24 04:01:17 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 11:01:17 +0100 Subject: [Rxtx] parity missed Message-ID: <42BBD9ED.3060004@emation.pt> Hi, I have a "parity missed error". From previous posts I believe this has to do with CMSPAR not being defined. I checked out 2.1 head from CVS. How can I make sure I do a proper build and CMSPAR is defined ? Perhaps it would be good to have a release snapshot that has this, I think the latest snapshot (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. Another question I have, is why must this depend on kernel headers, why can't it be defined in the RXTX source ? thanks Ricardo From jasmine at electronpusher.org Fri Jun 24 04:09:06 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 24 Jun 2005 11:09:06 +0100 Subject: [Rxtx] web start + RXTX = strange errors? In-Reply-To: References: Message-ID: <644aad2bdbba950f0a2fb12d7dcfd8a6@electronpusher.org> On 23 Jun 2005, at 11:39, Dr. Douglas Lyon wrote: > OK, I have updated the disto to work with jdk1.3: > http://show.docjava.com:8086/book/cgij/code/jnlp/ > addbk.JAddressBook.Main.jnlp > > Jasmine: Is this working any better? Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) -J. From taj at www.linux.org.uk Fri Jun 24 10:54:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 17:54:12 +0100 (BST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: On Fri, 24 Jun 2005, Vlado Handziski wrote: > Hi all, > > let me first express my compliments on the great work you have done with > the RXTX library. > > We have been using the library for some time, and we are at a point where > we want to make our code public. For legacy reasons, the code that the > RXTX library is bundled with, uses the javax.comm namespace. We have been > using the ChangePackage script to change the RXTX2.1 package from gnu.io > into javax.comm. We need the independent implementation since we want to > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > versions are just not as stable. > > On the download page, there is a comment that this is in violation of > sun's license. Can someone shed more light on this. I was not aware that > you can protect the names of the java packages. > > Best regards, > Vlado > I can't provide legal advice as I am not a lawyer. (v) may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are contained in the "java", "javax" or "sun" packages or similar as specified by Sun in any class file naming convention; and The license is in the commapi package from Sun. The above is also in all the EULA's you click through to download from Sun if I'm not mistaken. Simply put, the license taints developers that agree to it. For those developers, Sun has control of the javax.comm namespace. It really does not make sense to put rxtx 2.1 in the javax.comm namespace. It will only cause confusion which I think is the point of the clause above. The gnu.io namespace was perhaps a poor choice and just tossed in when reviewing the license to get out of Sun's namespace. There is nothing in the rxtx license limiting your freedom in this fashion though. Many companies are moving to gnu.io and some distribute it with popular applications you would recognize. I'm tempted to ask you not to contaminate rxtx 2.1 with the javax.comm namespace. You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) extensions to existing classes (which I dont think you are using); it is not just javax.comm. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 24 13:24:09 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 20:24:09 +0100 (BST) Subject: [Rxtx] parity missed In-Reply-To: <42BBD9ED.3060004@emation.pt> References: <42BBD9ED.3060004@emation.pt> Message-ID: On Fri, 24 Jun 2005, Ricardo Trindade wrote: > Hi, > > I have a "parity missed error". From previous posts I believe this > has to do with CMSPAR not being defined. > I checked out 2.1 head from CVS. How can I make sure I do a proper > build and CMSPAR is defined ? Perhaps it would be good to have a release > snapshot that has this, I think the latest snapshot > (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. > > Another question I have, is why must this depend on kernel headers, > why can't it be defined in the RXTX source ? > I used to cheat and grab the CMSPAR from the kernel headers because glibc did not have it. Now rxtx uses the glibc headers and we have a patch in glibc I trust that handles this. It would not be right to override glibc and it wasnt right to use the kernel headers (it really did cause problems). You can override glibc for now with the following in the top of SerialImp.c # define CMSPAR 010000000000 You can check if your distro headers have this right bit looking for the above in bits/termios.h. It should look like this: #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif If it is not defined, please file a bug with your distro as rxtx is not the only thing that will be broken on that distro. I was going to release new cvs snapshots last weekend but got tied up. I'll do it this weekend. I also need to get custom baudrate patches into the cvs snapshot. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Fri Jun 24 13:56:50 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 20:56:50 +0100 Subject: [Rxtx] parity missed In-Reply-To: References: <42BBD9ED.3060004@emation.pt> Message-ID: <42BC6582.2070805@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050624/e3b39631/attachment-0395.html From vlado.handziski at gmail.com Sat Jun 25 06:25:52 2005 From: vlado.handziski at gmail.com (Vlado Handziski) Date: Sat, 25 Jun 2005 14:25:52 +0200 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: <697986ec05062505256ebf381f@mail.gmail.com> Thanks for the clarification. Since changing the bundled source is not an option at this moment, we will consider using javax.comm and RXTX2.0. In the next rewrite, we would probably move to gnu.io . Best regards, Vlado Handziski On 6/24/05, Trent Jarvi wrote: > > On Fri, 24 Jun 2005, Vlado Handziski wrote: > > > Hi all, > > > > let me first express my compliments on the great work you have done with > > the RXTX library. > > > > We have been using the library for some time, and we are at a point > where > > we want to make our code public. For legacy reasons, the code that the > > RXTX library is bundled with, uses the javax.comm namespace. We have > been > > using the ChangePackage script to change the RXTX2.1 package from gnu.io > > into javax.comm. We need the independent implementation since we want to > > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > > versions are just not as stable. > > > > On the download page, there is a comment that this is in violation of > > sun's license. Can someone shed more light on this. I was not aware that > > you can protect the names of the java packages. > > > > Best regards, > > Vlado > > > > I can't provide legal advice as I am not a lawyer. > > (v) may not create, or authorize your licensees to create additional > classes, interfaces, or subpackages that are contained in the "java", > "javax" or "sun" packages or similar as specified by Sun in any class file > naming convention; and > > The license is in the commapi package from Sun. The above is also in all > the EULA's you click through to download from Sun if I'm not mistaken. > > Simply put, the license taints developers that agree to it. For those > developers, Sun has control of the javax.comm namespace. > > It really does not make sense to put rxtx 2.1 in the javax.comm namespace. > It will only cause confusion which I think is the point of the clause > above. The gnu.io namespace was perhaps a poor choice and > just tossed in > when reviewing the license to get out of Sun's namespace. > > There is nothing in the rxtx license limiting your freedom in this fashion > though. Many companies are moving to gnu.io and some > distribute it with > popular applications you would recognize. I'm tempted to ask you not > to contaminate rxtx 2.1 with the javax.comm namespace. > > You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm > using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) > extensions to existing classes (which I dont think you are using); it is > not just javax.comm. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050625/1dadc50e/attachment-0395.html From taj at www.linux.org.uk Sun Jun 26 11:34:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 26 Jun 2005 18:34:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. Message-ID: The attached file should fix baud_base and divisor extensions for Linux The patch is against rxtx 2.1 CVS HEAD. To use this patch, you should set the baud rate to 38400. You can then try SerialPort.setBaudBase(int) and SerialPort.setDivisor(int) There are matching int SerialPort.getBaudBase() and int SerialPort.getDivisor(). What baud bases are available depends upon the serial port card and its driver so this is a bit of a blind attempt on my part. I've looked at the w32 API and I dont see anything available yet. The w32 code in RXTX will probably be figuring out the baud rate based on the tried baud base and divisor and just slamming it at the API for now (the API does something with that but I've not found real documentation on what it does). I dont want to try tinkering with the UART directly yet as that would involve poking machine memory directly and could very easily be error prone in bad ways. I don't expect Solaris or any SysV UNIX systems to work at all with this - ever. It is not standard in any way and will throw Exceptions on everything but Linux (w32 will just fail miserably as it is 1/2 implemented). If anyone has looked at custom baud rates before and has some thoughts or just wants to try the attached untested patch, I'd appreciate any feedback. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- ? autom4te.cache ? build ? output cvs server: Diffing . Index: configure =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure,v retrieving revision 1.35.2.59 diff -u -r1.35.2.59 configure --- configure 16 Oct 2004 16:20:34 -0000 1.35.2.59 +++ configure 26 Jun 2005 16:59:28 -0000 @@ -9644,6 +9644,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { #if defined (__GLIBC__) @@ -9782,6 +9784,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { @@ -9825,7 +9829,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -9837,7 +9841,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 26 Jun 2005 16:59:28 -0000 @@ -218,6 +218,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { #if defined (__GLIBC__) @@ -356,6 +358,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { @@ -399,7 +403,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -411,7 +415,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" cvs server: Diffing CNI cvs server: Diffing MACOSX_IDE cvs server: Diffing MACOSX_IDE/CW cvs server: Diffing MACOSX_IDE/ForPackageMaker cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions cvs server: Diffing MACOSX_IDE/ForPackageMaker/Resources cvs server: Diffing MACOSX_IDE/PB cvs server: Diffing WinCE cvs server: Diffing contrib cvs server: Diffing debian cvs server: Diffing src Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 26 Jun 2005 16:59:29 -0000 @@ -2079,15 +2079,17 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int BaudBase The clock frequency divided by 16. Default * BaudBase is 115200. * @return boolean true on success - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:setBaudBase()"); @@ -2097,10 +2099,11 @@ /** * Extension to CommAPI * @return int BaudBase - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getBaudBase() throws UnsupportedCommOperationException + public int getBaudBase() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getBaudBase()"); @@ -2108,13 +2111,14 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, IOException { if ( debug ) z.reportln( "RXTXPort:setDivisor()"); @@ -2124,10 +2128,11 @@ /** * Extension to CommAPI * @returns int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getDivisor() throws UnsupportedCommOperationException + public int getDivisor() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getDivisor()"); Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 26 Jun 2005 16:59:30 -0000 @@ -1877,16 +1877,27 @@ int fd = get_java_var( env, jobj,"fd","I" ); struct serial_struct sstruct; + if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) + { + goto fail; + } + + sstruct.baud_base = (int) BaudBase; + if ( sstruct.baud_base < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetBaudBase", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetBaudBase", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1914,9 +1925,13 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) ( sstruct.baud_base ) ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetBaudBase", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetBaudBase", strerror( errno ) ); @@ -1950,19 +1965,23 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } if ( sstruct.custom_divisor < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetDivisor", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetDivisor", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1971,7 +1990,7 @@ accept: none perform: Find the Divisor used for custom speeds - return: Divisor + return: Divisor negative value on error. exceptions: Unsupported Comm Operation on systems not supporting TIOCGSERIAL comments: @@ -1990,10 +2009,14 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) sstruct.custom_divisor ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetDivisor", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetDivisor", strerror( errno ) ); @@ -2032,7 +2055,7 @@ /* Open and lock the port so nothing else changes the setting */ - if ( LOCK( filename, pid ) ) goto fail;; + if ( LOCK( filename, pid ) ) goto fail; fd = find_preopened_ports( filename ); if( !fd ) Index: src/SerialPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/Attic/SerialPort.java,v retrieving revision 1.3.2.9 diff -u -r1.3.2.9 SerialPort.java --- src/SerialPort.java 12 Oct 2004 08:59:28 -0000 1.3.2.9 +++ src/SerialPort.java 26 Jun 2005 16:59:30 -0000 @@ -103,13 +103,17 @@ public abstract String getUARTType() throws UnsupportedCommOperationException; public abstract boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getBaudBase() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getDivisor() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setLowLatency() throws UnsupportedCommOperationException; public abstract boolean getLowLatency() cvs server: Diffing src/lfd cvs server: Diffing src/psmisc From uwe at kubosch.no Mon Jun 27 14:13:57 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Mon, 27 Jun 2005 22:13:57 +0200 Subject: [Rxtx] RXTX on FC4 Message-ID: <1119903238.2989.27.camel@BPC0276> Hi all! I just got RXTX to work on Fedora Core 4. The standard download did not work. I had to check the code out from CVS and build it, but then it worked flawlessly. Thanks for your good work. Now I wonder if I should contribute the compiled files so that others will have an easier time than me getting RXTX to work on FC4. What do I do? Who do I talk to? donV From taj at www.linux.org.uk Mon Jun 27 14:29:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 27 Jun 2005 21:29:46 +0100 (BST) Subject: [Rxtx] RXTX on FC4 In-Reply-To: <1119903238.2989.27.camel@BPC0276> References: <1119903238.2989.27.camel@BPC0276> Message-ID: On Mon, 27 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I just got RXTX to work on Fedora Core 4. > > The standard download did not work. > > I had to check the code out from CVS and build it, but then it worked > flawlessly. > > Thanks for your good work. > > Now I wonder if I should contribute the compiled files so that others > will have an easier time than me getting RXTX to work on FC4. What do I > do? Who do I talk to? > > The best thing to do with FC is to contibute an extras RPM. Debian does something like this with their .deb packaging. As rxtx is OS neutral, it is almost impossible to have everything on rxtx.org. If you do get a package in Fedora Extras, I can point a link there. The extra's mail list is here: https://www.redhat.com/mailman/listinfo/fedora-extras-list If it would help to have me release a 'stable' .tar.gz of the source for the RPM submittal process I can do that. It would also trigger upgrades in debian which would not be bad. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Mon Jun 27 16:23:20 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 27 Jun 2005 17:23:20 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: Message-ID: <42C07C58.1030608@atcorp.com> Hey Trent, I installed it and now I get IOExceptions instead of the other one. I'm not sure how those changes would have enabled setDivisor and setBaudBase to work though. Is it significant that this is a USB device emulating a serial port? ~ Shawn From taj at www.linux.org.uk Mon Jun 27 18:07:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 01:07:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: <42C07C58.1030608@atcorp.com> References: <42C07C58.1030608@atcorp.com> Message-ID: On Mon, 27 Jun 2005, Shawn Lavelle wrote: > Hey Trent, > I installed it and now I get IOExceptions instead of the other one. > I'm not sure how those changes would have enabled setDivisor and > setBaudBase to work though. Is it significant that this is a USB device > emulating a serial port? > The USB driver probably does not support this. With USB, the ioctl()'s appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through the linux drivers/usb tree and found to ioctl to support this in Linux 2.6.10. RXTX is not doing very much magic, the patch really only gets the serial struct instead of writing a structure with random values for baudbase and handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel level driver issue not a user space library issue. So if you wanted this to work, the usb serial driver would have to handle the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression after looking through the USB tree quickly. I hope that helps. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Jun 27 18:25:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 27 Jun 2005 20:25:22 -0400 Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) Message-ID: Hi All, I wrote: Jasmine: Is this working any better? And Jasmine says: Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) I am using -source 1.3 and -target 1.3 for the compilation, however, we still seem to have this problem, which my machine (for some reason) does not have. Does anyone have any ideas about what might be the problem? Thanks! - DL From taj at www.linux.org.uk Mon Jun 27 19:04:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 02:04:37 +0100 (BST) Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) In-Reply-To: References: Message-ID: On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I wrote: > Jasmine: Is this working any better? > > And Jasmine says: > Nope. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > > I am using -source 1.3 and -target 1.3 > for the compilation, however, we still seem to have this problem, > which my machine (for some reason) does not have. > Does anyone have any ideas about what might be the problem? > This has shown up in the past with jdk 1.5 compiled jars running on jre 1.4 machines. My guess is either jasmine has an old copy of rxtx with the problem on her machine that is being picked up on the classpath or you have not tried this with jre 1.4. The suggested -source/target fix should avoid the problem. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Mon Jun 27 21:23:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 04:23:55 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: On Tue, 28 Jun 2005, Trent Jarvi wrote: > On Mon, 27 Jun 2005, Shawn Lavelle wrote: > > > Hey Trent, > > I installed it and now I get IOExceptions instead of the other one. > > I'm not sure how those changes would have enabled setDivisor and > > setBaudBase to work though. Is it significant that this is a USB device > > emulating a serial port? > > > > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > > RXTX is not doing very much magic, the patch really only gets the serial > struct instead of writing a structure with random values for baudbase and > handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel > level driver issue not a user space library issue. > > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. > > I hope that helps. > > > It may be possible that you can just modify translate_speed and get_java_baudrate in SerialImp.c to have the new high speds you are after. The defines are in /usr/include/termios.h. #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 You can see many of these are not handled. I dont think CommAPI handled more than 57600 or so. int get_java_baudrate( int native_speed ) { switch( native_speed ) { case B0: return 0; case B50: return 50; case B75: return 75; case B110: return 110; case B134: return 134; case B150: return 150; case B200: return 200; case B300: return 300; case B600: return 600; case B1200: return 1200; case B1800: return 1800; case B2400: return 2400; case B4800: return 4800; case B9600: return 9600; case B19200: return 19200; case B38400: return 38400; case B57600: return 57600; default: return -1; } } int translate_speed( JNIEnv *env, jint speed ) { LEAVE( "RXTXPort:translate_speed" ); switch( speed ) { case 0: return B0; case 50: return B50; case 75: return B75; case 110: return B110; case 134: return B134; case 150: return B150; case 200: return B200; case 300: return B300; case 600: return B600; case 1200: return B1200; case 1800: return B1800; case 2400: return B2400; case 4800: return B4800; case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; #ifdef B57600 case 57600: return B57600; #endif /* B57600 */ #ifdef B115200 case 115200: return B115200; #endif /* B115200 */ #ifdef B230400 case 230400: return B230400; #endif /* B230400 */ #ifdef B460800 case 460800: return B460800; #endif /* B460800 */ #ifdef B14400 case 14400: return B14400; #endif /* B14400 */ #ifdef B28800 case 28800: return B28800; #endif /* B28800 */ #ifdef B128000 /* dima */ case 128000: return B128000; #endif /* dima */ #ifdef B256000 /* dima */ case 256000: return B256000; #endif /* dima */ } /* Handle custom speeds */ if( speed >= 0 ) return speed; else { LEAVE( "RXTXPort:translate_speed: Error condition" ); return -1; } } -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 28 05:20:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 28 Jun 2005 07:20:21 -0400 Subject: [Rxtx] cross-compilation using Make for Mac Message-ID: Hi All, Please excuse the long post; Trent said: >" >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. " Here is what I have on the mac version: java -version java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) When I run: http://show.docjava.com:8086/book/cgij/code/jnlp/math.benchmarks.Dhry.jnlp I get: -- listing properties -- jnlpx.heapsize=NULL,NULL jnlpx.splashport=-1 java.runtime.name=Java(TM) 2 Runtime Environment, Stand... java.protocol.handler.pkgs=com.sun.javaws.net.protocol sun.boot.library.path=/System/Library/Frameworks/JavaVM.fra... java.vm.version=1.4.2-38 awt.nativeDoubleBuffering=true gopherProxySet=false http.auth.serializeRequests=true java.vm.vendor="Apple Computer, Inc." java.vendor.url=http://apple.com/ path.separator=: java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io jnlpx.home=/Applications/Utilities/Java/Java Web... user.country=US sun.os.patch.level=unknown java.vm.specification.name=Java Virtual Machine Specification user.dir=/ java.runtime.version=1.4.2_05-141.4 java.awt.graphicsenv=apple.awt.CGraphicsEnvironment java.endorsed.dirs=/System/Library/Frameworks/JavaVM.fra... os.arch=ppc java.io.tmpdir=/tmp line.separator= java.vm.specification.vendor=Sun Microsystems Inc. jnlpx.remove=false os.name=Mac OS X sun.java2d.fontpath= java.library.path=/Applications/Utilities/Java/Java Web... java.specification.name=Java Platform API Specification java.class.version=48.0 jnlpx.deployment.user.home=/Users/lyon/Library/Caches/Java Web S... java.util.prefs.PreferencesFactory=java.util.prefs.MacOSXPreferencesFactory os.version=10.3.9 user.home=/Users/lyon user.timezone=America/New_York java.security.policy=file:/Applications/Utilities/Java/Jav... java.awt.printerjob=apple.awt.CPrinterJob trustProxy=true java.specification.version=1.4 file.encoding=MacRoman jnlpx.deployment.system.home=/Applications/Utilities/Java/J2SE 5.0... user.name=lyon java.class.path=/Applications/Utilities/Java/Java Web... java.vm.specification.version=1.0 sun.arch.data.model=32 java.home=/System/Library/Frameworks/JavaVM.fra... java.specification.vendor=Sun Microsystems Inc. user.language=en awt.toolkit=apple.awt.CToolkit java.vm.info=mixed mode java.version=1.4.2_05 java.ext.dirs=/Users/lyon/Library/Java/Extensions:/... sun.boot.class.path=/System/Library/Frameworks/JavaVM.fra... java.vendor=Apple Computer, Inc. file.separator=/ java.vendor.url.bug=http://developer.apple.com/java/ sun.cpu.endian=big sun.io.unicode.encoding=UnicodeBig mrj.version=141.3 jnlpx.jvm=/System/Library/Frameworks/JavaVM.fra... sun.cpu.isalist= sun.awt.exception.handler=apple.awt.CToolkit$EventQueueExceptio... javawebstart.version=javaws-1.4.2_05 800 mhz g4,878k ds/sec total time: 1184ms Result: 844594 dhrystone/sec. Load average for last 15 minutes:0.62 So, I feel pretty sure that I have tried this with 1.4. As to modifying the RXTX compilation, that I did not do...and I take your point. I have been using the binary distributions as is. Oops. I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Now when I do a make, I get: make gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known libtool: link: warning: undefined symbols not allowed in i386-pc-mingw32 shared libraries rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ln: `SerialImp.o': File exists make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 So, I do a make clean, then a make: .... (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ar cru .libs/librxtxSerial.a /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o ar: /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o: No such file or directory make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 In the i386 directory, there is a symbolic link left from something: ls -al SerialImp.o lrwxrwxrwx 1 lyon lyon 12 Jun 28 07:03 SerialImp.o -> SerialImp.lo However, the SerialImp.lo is not present (which is the cause of the error, I think). On the other hand, the file I am looking for is present in: i686-pc-linux-gnu Possibly the i386 generation is not clean (of course it is also likely that I am just asking dumb questions, being a newbie to the code and all.). Finally, will this make file regenerate the distro for the mac? I found some really old (from year 2001) files in: cvs/MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions Which I could use for the distro...but I would prefer to do a clean, multi-platform build from make. Thanks! - Doug >On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > >> Hi All, >> I wrote: >> Jasmine: Is this working any better? >> >> And Jasmine says: >> Nope. >> >> An error occurred while launching/running the application. >> >> Title: addbk.JAddressBook.Main >> Vendor: DocJava, Inc. >> Category: Unexpected Error >> >> gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) >> >> > > I am using -source 1.3 and -target 1.3 >> for the compilation, however, we still seem to have this problem, >> which my machine (for some reason) does not have. >> Does anyone have any ideas about what might be the problem? >> > >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. > > >The suggested -source/target fix should avoid the problem. > >-- >Trent Jarvi >tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 28 09:43:41 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 28 Jun 2005 10:43:41 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: <42C1702D.1070307@atcorp.com> > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. There is ioctl stuff in the driver for the chip, but i haven't seen the TIOC*SERIAL entries. That might be why it continues to fail. I did get around the problem, though, by hacking the driver and just specifying the baud rate I need. Now everything works well. Thanks for all the assistance you've provided. ~ Shawn M. Lavelle From taj at www.linux.org.uk Tue Jun 28 12:42:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:42:29 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known Add a compiler flag -DWIN32 The code above should not be compiling on w32 as it is #if !defined(WIN32) You can look at the bottom of Makefile.in to see the w32 compile flags. Search for "WIN32 CrossCompiling from here down" If its still not working, I can set you up with the Bob account. Just email me off the list. W32 compiling is a bit complicated. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 28 12:52:50 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:52:50 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Nods. I did change configure but right now it is only in the baudbase/divisor patch I posted. I'm going to add several extension baud rates that can be supported by normal API calls and commit that today as a followup to my comments yesterday on baudrates. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Wed Jun 29 01:52:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 08:52:10 +0100 (BST) Subject: [Rxtx] [PATCH] More baud rate fixes Message-ID: I went through the native baudrate conversion from Java and added several. This patch is against CVS 2.1 head. I think thats it for baud rate fixes unless someone see something. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- A non-text attachment was scrubbed... Name: baud_base_and_divisor_plus_odd_baudrates.diff.gz Type: application/x-gzip Size: 3291 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050629/4c1ef1c2/baud_base_and_divisor_plus_odd_baudrates.diff-0395.gz From lyon at docjava.com Wed Jun 29 10:33:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 29 Jun 2005 12:33:45 -0400 Subject: [Rxtx] java.comm dependencies Message-ID: Hi All, During a build of the rxtx code, I have left the javax.comm out of the system (on purpose). However, I get an error, at run time: CommPortIdentifier:static initialization() apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: javax/comm/CommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver I am thinking that there is something in the gnu.io.CommPortIdentifier that seeks to load the javax.comm.CommDriver. It was my understanding that we could write code without reference to the javax.comm.CommDriver and that we could work in the gnu namespace. Is this true? Thanks! - Doug From taj at www.linux.org.uk Wed Jun 29 11:16:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 18:16:08 +0100 (BST) Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > During a build of the rxtx code, I have left the > javax.comm out of the system (on purpose). > However, I get an error, at run time: > > CommPortIdentifier:static initialization() > apple.awt.EventQueueExceptionHandler Caught Throwable : > java.lang.NoClassDefFoundError: javax/comm/CommDriver > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > that seeks to load the javax.comm.CommDriver. > > It was my understanding that we could write code without reference > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > Is this true? > Yes. People use 2.1 without javax all the time. There should be no reference to javax at all in rxtx 2.1. You may check your code. I just did a grep through 2.1 and there is nothing. You may look at the classes you are using. If you find javax.comm in your code, replace it with gnu.io and that should be all you need to do. -- Trent Jarvi tjarvi at qbang.org From jayant28k at gmail.com Wed Jun 29 21:49:28 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Thu, 30 Jun 2005 09:19:28 +0530 Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: <6a6a02310506292049778c452f@mail.gmail.com> Trent, I think best idea is to have wiki for rxtx code. So as the traffic is increasing with time. "RXTX" seems to be more popular in embbeded system. Sun Microsystems will always apperciate your efforts on parallel and serial ports commincation based application in IT Industry. Thanks for your help on this forum as "ONE MAN ARMY" ;-) Cheers, Jayant On 6/29/05, Trent Jarvi wrote: > On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > > > Hi All, > > During a build of the rxtx code, I have left the > > javax.comm out of the system (on purpose). > > However, I get an error, at run time: > > > > CommPortIdentifier:static initialization() > > apple.awt.EventQueueExceptionHandler Caught Throwable : > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > > that seeks to load the javax.comm.CommDriver. > > > > It was my understanding that we could write code without reference > > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > > > Is this true? > > > > Yes. People use 2.1 without javax all the time. > > There should be no reference to javax at all in rxtx 2.1. You may check > your code. I just did a grep through 2.1 and there is nothing. You may > look at the classes you are using. > > If you find javax.comm in your code, replace it with gnu.io and that > should be all you need to do. > > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From uwe at kubosch.no Sat Jun 25 02:50:24 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Sat, 25 Jun 2005 10:50:24 +0200 Subject: [Rxtx] RXTX in FC3/FC4 Message-ID: <1119689424.12606.14.camel@BPC0276> Hi all! I am trying to get RXTX to work on Fedora Core, version 3 or 4. I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext directory. I have edited the jre/lib/javax.comm.properties according to the docs. I have tried this with both rxtx 2.0 and 2.1. I have tried on two different machines. I have tried with java 1.4.2 and java 1.5.0, both from Sun. I always get a signall 11 from the native libraries when they are loaded. Is this a common problem? Any help is greatly appreciated. Below is the start of the error message. More can be supplied on demand. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x65015A Function=(null)+0x65015A Library=/lib/ld-linux.so.2 NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) - locked <0xed46f628> (a java.util.Vector) - locked <0xed471708> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xed46ebc0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.InitializeDriver(CommPortIdentifier.java:213) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:248) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:351) at com.jpeterson.x10.module.CM11A.allocate(CM11A.java:1160) at net.sourceforge.cruisecontrol.publishers.X10Publisher.send(X10Publisher.java:182) at net.sourceforge.cruisecontrol.publishers.X10Publisher.turnOff(X10Publisher.java:171) at net.sourceforge.cruisecontrol.publishers.X10Publisher.handleBuild(X10Publisher.java:148) at net.sourceforge.cruisecontrol.publishers.X10Publisher.publish(X10Publisher.java:141) at net.sourceforge.cruisecontrol.Project.publish(Project.java:679) at net.sourceforge.cruisecontrol.Project.build(Project.java:227) at net.sourceforge.cruisecontrol.Project.execute(Project.java:153) at net.sourceforge.cruisecontrol.ProjectWrapper.run(ProjectWrapper.java:66) at java.lang.Thread.run(Thread.java:534) From chris_jh at blueyonder.co.uk Tue Jun 28 05:37:10 2005 From: chris_jh at blueyonder.co.uk (Christopher Harris) Date: Tue, 28 Jun 2005 12:37:10 +0100 Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError Message-ID: <42C13666.9030108@blueyonder.co.uk> Hi I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 32bit) The serial ports work fine with no issues, but when i try to use the parallel port i get this message Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:66) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) I am trying to print a line out to port "/dev/lp0" At first i thought it could not find the librxtxParallel.so file, but when i renamed it i got a different saying it could not find the library. I have tried to run as root no difference. It is really weird, i get no compile errors and the serial ports work fine. I changed the LPRPort.java and commented out the Initialize call method. And just get the same error but for the method open. It is as though it can't see the methods, and yet it can see the library. I did have a bit of check of the JNI implementation in rxtx but could not spot anything. Yours Thankfully Christopher Harris From lyon at docjava.com Thu Jun 30 02:28:09 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 04:28:09 -0400 Subject: [Rxtx] tools Message-ID: Hi All, I have been thinking about automatic cross-platform native method development of Java/C programs. It appears that different binary tools are needed to target different platforms. Configuration seems a bit painful. Is there something better available than make? Is ANT any good at this? Has anyone tried: http://jnipp.sourceforge.net/ Thanks! - Doug From lyon at docjava.com Thu Jun 30 04:11:17 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 06:11:17 -0400 Subject: [Rxtx] javax.comm Message-ID: Hi All, When I load my jar files on a linux box, all is well. However, when I load them on a mac, I get: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver The jar files for the mac are different from the jar files for linux, because recompilation of the native code for the mac has not been easy, for me. As a result, the RXTX jars are tending toward specific versions and platforms. Probably, this is not an ideal situation, but, I suspect, it is common. I have an idea that we could create a single JNLP distro site that we can make reference to that would enable a uniform repository of synchronized signed native methods and jars for RXTX. For example, the one-wire Maxim folks have a real-nice approach where their stuff makes reference to another JNLP file that contains all the stuff we need to make RXTX work. Check it out at: http://www.maxim-ic.com/products/ibutton/software/1wire/OneWireViewer.cfm However, even they have problems on an unconfigured machine: Specified adapter name "DS9097U" is not known * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cannot load default adapter. Please check that the adapter is connected and that no other application is using the port. If you have checked the adapter, the default port might not be selected. Either set the value of the TMEX default using the utility provided with the TMEX Runtime, or create a new file in the /lib folder called onewireviewer.properties with two lines, similar to the following: #native win32 drivers adapter.name={DS9097U} adapter.port=COM1 #or javax.comm drivers adapter.name=DS9097U adapter.port=COM1 The full path to this file should be: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/onewireviewer.properties ---- Wow, that is a show stopper! Configuration is something that we really need to think about as an automatic thing, particularly for web start users. You can't ask a person who wants to run an application to figure out how to alter a properties file. If you know you need one, then get permission and make one...automatically. That makes a lot of sense, to me. Basically, we need an installer. At the very least, all the pre-built binaries and jars needed for the RXTX package on several platforms should be available from a single place. One this happens, we can make a JNLP file that is platform specific, but can give us a level of indirection. Is this something that has been done already? Thanks! - Doug From taj at www.linux.org.uk Thu Jun 30 08:10:22 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 15:10:22 +0100 (BST) Subject: [Rxtx] tools In-Reply-To: References: Message-ID: On Thu, 30 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I have been thinking about automatic cross-platform > native method development of Java/C programs. > > It appears that different binary tools are needed to target different > platforms. Configuration seems a bit painful. > > Is there something better available than make? > > Is ANT any good at this? I'm far from an Ant expert but have used it for other projects. The main problem I see with ant is there is no mainstream support for platform neutral neutral library creation as far as I can tell. I think ant is a fine replacement for make but I've not seen a suitable replacement for autoconf. At that point, make is as good as anything. It should be possible to create a ant build.xml that works on say Solaris, Linux, Windows and Mac OS X. The problem is when you are trying to build a library for embeded ARM from Mac OS X. > Has anyone tried: > http://jnipp.sourceforge.net/ -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:22:02 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:22:02 +0100 (BST) Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <1119689424.12606.14.camel@BPC0276> References: <1119689424.12606.14.camel@BPC0276> Message-ID: On Sat, 25 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I am trying to get RXTX to work on Fedora Core, version 3 or 4. > > I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 > directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext > directory. > > I have edited the jre/lib/javax.comm.properties according to the docs. > > I have tried this with both rxtx 2.0 and 2.1. > > I have tried on two different machines. > > I have tried with java 1.4.2 and java 1.5.0, both from Sun. > > I always get a signall 11 from the native libraries when they are > loaded. Is this a common problem? Any help is greatly appreciated. > Below is the start of the error message. More can be supplied on > demand. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x65015A > Function=(null)+0x65015A > Library=/lib/ld-linux.so.2 > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) If you compile rxtx from source, this will probably go away. I'm not sure what the exact cause is but it looks like the binaries are not suitable for FC3/4. The ABI may have changed since those had been compiled. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:26:56 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:26:56 +0100 (BST) Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError In-Reply-To: <42C13666.9030108@blueyonder.co.uk> References: <42C13666.9030108@blueyonder.co.uk> Message-ID: tOn Tue, 28 Jun 2005, Christopher Harris wrote: > Hi > > I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 > 32bit) > > The serial ports work fine with no issues, but when i try to use the > parallel port i get this message > > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:66) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) > > > I am trying to print a line out to port "/dev/lp0" > > At first i thought it could not find the librxtxParallel.so file, but > when i renamed it i got a different saying it could not find the library. > > I have tried to run as root no difference. > > It is really weird, i get no compile errors and the serial ports work fine. > > I changed the LPRPort.java and commented out the Initialize call method. > And just get the same error but for the method open. > > It is as though it can't see the methods, and yet it can see the library. > I did have a bit of check of the JNI implementation in rxtx but could > not spot anything. > > > You can check if the symbols are in the shared library: nm librxtxSerial.so |grep Initialize If the symbols are not there, there was a build error. Watch very close for build errors while compiling from source. I suspect something isnt behaving right. -- Trent Jarvi tjarvi at qbang.org From allen at adbyrne.us Thu Jun 30 06:55:58 2005 From: allen at adbyrne.us (Allen Byrne) Date: Thu, 30 Jun 2005 07:55:58 -0500 Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> References: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> Message-ID: <200506300755.59159.allen@adbyrne.us> On Thursday 30 June 2005 00:31, rxtx-request at mail.electronpusher.org wrote: > >Message: 8 >Date: Sat, 25 Jun 2005 10:50:24 +0200 >From: Uwe Kubosch >Subject: [Rxtx] RXTX in FC3/FC4 >To: rxtx at mail.electronpusher.org >Message-ID: <1119689424.12606.14.camel at BPC0276> >Content-Type: text/plain > >Hi all! > >I am trying to get RXTX to work on Fedora Core, version 3 or 4. > >I have tried this with both rxtx 2.0 and 2.1. > >I have tried on two different machines. > >I have tried with java 1.4.2 and java 1.5.0, both from Sun. > >I always get a signall 11 from the native libraries when they are >loaded. ?Is this a common problem? ?Any help is greatly appreciated. >Below is the start of the error message. ?More can be supplied on >demand. > >An unexpected exception has been detected in native code outside the VM. >Unexpected Signal : 11 occurred at PC=0x65015A >Function=(null)+0x65015A >Library=/lib/ld-linux.so.2 > I had thi same problem on SUSE9.3 and java 1.5.0. After searching through the archives, I found a patch that required adding a sleep(1000) command in two functions of SerialIO.java. This only was for rxtx2.1, I had no trouble with rxtx2.0. Note, also I had to add the "|1.5*" sequence to the configure.in file to get good *.so libs. Again 2.0 was fine. -- Allen Byrne adbyrne at ieee.org http://modelrr.adbyrne.us From taj at www.linux.org.uk Fri Jun 3 01:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 08:57:29 +0100 (BST) Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 3 09:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 16:57:53 +0100 (BST) Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi at qbang.org From jasmine at electronpusher.org Fri Jun 3 10:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 17:12:21 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 11:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:02:09 +0100 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 11:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:05:10 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From jon.nall at gmail.com Mon Jun 6 09:13:58 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 10:13:58 -0500 Subject: [Rxtx] StackOverflowError Message-ID: I have a fairly small application that is communicating to a microcontroller programmer at 115.2k. I have a test where I try and dump the memory of the microcontroller (whose size is 8k and change). Things are going smoothly and the data looks good. Then after reading out ~6.5k of data, I get a StackOverflowError. The stack trace looks like: CommInterface.serialEvent(): 324 // this is my code RXTXPort.sendEvent(): 732 RXTXPort.eventLoop() [Native] MonitorThread.run(): 1531 I am running on windows and using rxtx-2.1-CVS-20050120. When I increased the stack size to 512k, I could read the entire chip without issue. But that doesn't seem like the right thing to do without root causing what's happening. My code doesn't include any recursion and the stack trace looks terribly short, so I'm a bit confused as to why I'm getting a StackOverflowError. CommInterface.serialEvent() does little more than grab the available bytes, enter a synchronized block, stick them in a common data area for the main thread to use and leave the synchronization block. I guess my question is: are there any known issues with the default stack size when using the latest rxtx on windows? thanks, nall. From taj at www.linux.org.uk Mon Jun 6 09:27:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 16:27:34 +0100 (BST) Subject: [Rxtx] StackOverflowError In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > I have a fairly small application that is communicating to a > microcontroller programmer at 115.2k. I have a test where I try and > dump the memory of the microcontroller (whose size is 8k and change). > Things are going smoothly and the data looks good. Then after reading > out ~6.5k of data, I get a StackOverflowError. The stack trace looks > like: > > CommInterface.serialEvent(): 324 // this is my code > RXTXPort.sendEvent(): 732 > RXTXPort.eventLoop() [Native] > MonitorThread.run(): 1531 > > I am running on windows and using rxtx-2.1-CVS-20050120. When I > increased the stack size to 512k, I could read the entire chip without > issue. But that doesn't seem like the right thing to do without root > causing what's happening. My code doesn't include any recursion and > the stack trace looks terribly short, so I'm a bit confused as to why > I'm getting a StackOverflowError. > > CommInterface.serialEvent() does little more than grab the available > bytes, enter a synchronized block, stick them in a common data area > for the main thread to use and leave the synchronization block. > > I guess my question is: are there any known issues with the default > stack size when using the latest rxtx on windows? > This is the first I've heard of the problem. It is strange as you mention lookin at the stack trace. That cant be taking up too much space. If you just toss the data instead of trying to put it in your work area, does it persist? -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Mon Jun 6 10:09:39 2005 From: lengyel at gmail.com (FL) Date: Mon, 6 Jun 2005 12:09:39 -0400 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on which the jdk1.5.0_03 is installed. I found that the INSTALL documentation seems to be in error. It states that javacomm20-x86.tar.Z (the Java Communications API for Solaris/x86) must be used, in fact this choice led to the following test with theBlackBox sample program in the commapi: root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG BlackBox -p /dev/ttyS0 Port /dev/ttyS0 not found! No serial ports found! Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to cause Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to the Eclipse stable build version 3.1M7 to avoid this. However, I found that using the Solaris/Sparc version of commapi worked on my system. I have documented this on: http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050606/b28fb9a7/attachment-0396.html From taj at www.linux.org.uk Mon Jun 6 10:30:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:30:27 +0100 (BST) Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, FL wrote: > I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on > which the jdk1.5.0_03 is installed. I found that the INSTALL documentation > seems to be in error. It states that javacomm20-x86.tar.Z (the Java > Communications API for Solaris/x86) must be used, in fact this choice led to > the following test with theBlackBox sample program in the commapi: > > root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG > BlackBox -p /dev/ttyS0 > Port /dev/ttyS0 not found! > No serial ports found! > > Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to > cause > Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to > the Eclipse stable build version 3.1M7 to avoid this. > > However, I found that using the Solaris/Sparc version of commapi > worked on my system. > > I have documented this on: > > http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 > Thanks FL. I'll change the documentation to point to the SPARC comm.jar. In the past, any Solaris was good enough, we tried to avoid the w32 comm.jar because it made native calls rxtx would never implement on any OS as they are not platform neutral. I'll withold comments about Sun's comm.jar being different on various CPUs within even the same OS. RXTX 2.1 does not need to do that even acrossed OSs for instance. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 6 10:35:43 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 11:35:43 -0500 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API Message-ID: It seems that Sun's javax.comm site does not include JavaDoc'ed API and the RxTx site has the API, but no real documentation. Is there some site that i'm just missing in my google searches? I'm looking for a copy of the javax.comm API which is documented. Thanks, nall. From taj at www.linux.org.uk Mon Jun 6 10:44:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:44:03 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > It seems that Sun's javax.comm site does not include JavaDoc'ed API > and the RxTx site has the API, but no real documentation. Is there > some site that i'm just missing in my google searches? I'm looking for > a copy of the javax.comm API which is documented. > > Thanks, > nall. Sun's version is with their binary downloads. RXTX tries to match that so I never bothered with more complete JavaDocs. Whatever Sun documents is what we try to do. -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Mon Jun 6 12:13:44 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 6 Jun 2005 14:13:44 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: Message-ID: <20050606181245.528C929D56F@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Trent Jarvi > Sent: Monday, June 06, 2005 12:44 PM > To: Jon Nall; Java RXTX discussion > Subject: Re: [Rxtx] Where can I find JavaDoc on the javax.comm API > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > It seems that Sun's javax.comm site does not include JavaDoc'ed API > > and the RxTx site has the API, but no real documentation. Is there > > some site that i'm just missing in my google searches? I'm > looking for > > a copy of the javax.comm API which is documented. > > > > Thanks, > > nall. > > Sun's version is with their binary downloads. RXTX tries to > match that so I never bothered with more complete JavaDocs. > Whatever Sun documents is what we try to do. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Try http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht ml -Ack From gadelavega at yahoo.com.ar Mon Jun 6 12:58:09 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Mon, 6 Jun 2005 15:58:09 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606181245.528C929D56F@mail.electronpusher.org> Message-ID: <20050606185809.57069.qmail@web14603.mail.yahoo.com> --- "David S. Acker" escribi?: > > -----Original Message----- > > From: rxtx-bounces at mail.electronpusher.org > > [mailto:rxtx-bounces at mail.electronpusher.org] On > Behalf Of Trent Jarvi > > Sent: Monday, June 06, 2005 12:44 PM > > To: Jon Nall; Java RXTX discussion > > Subject: Re: [Rxtx] Where can I find JavaDoc on > the javax.comm API > > > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > > > It seems that Sun's javax.comm site does not > include JavaDoc'ed API > > > and the RxTx site has the API, but no real > documentation. Is there > > > some site that i'm just missing in my google > searches? I'm > > looking for > > > a copy of the javax.comm API which is > documented. > > > > > > Thanks, > > > nall. > > > > Sun's version is with their binary downloads. > RXTX tries to > > match that so I never bothered with more complete > JavaDocs. > > Whatever Sun documents is what we try to do. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > Try > http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > ml > -Ack > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > I'm prety sure it was there... but not anymore. Gonzalo A. de la Vega, BI ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From taj at www.linux.org.uk Mon Jun 6 18:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 01:09:14 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606185809.57069.qmail@web14603.mail.yahoo.com> References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: >> http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > > I'm prety sure it was there... but not anymore. > It is there. Maybe the URL got mangled. Try this http://tinyurl.com/8dfp7 It just redirects you to: http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.html -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 7 05:46:39 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Jun 2005 07:46:39 -0400 Subject: [Rxtx] rxtx under fedora - odd procedures Message-ID: Hi All, I was able to get RXTX communications to work under Fedora, but only after I added myself to the UUCP and LOCK groups, logged out and then logged back in. Both groups appear to be needed in order to access the serial ports. Also the group alter did not take until after I logged out and logged back in. My theory is that you need permission to write to the var/spool directory under fedora and that this is the only way to do it. Logging out and logging back in just seems like an odd thing to do. I suppose some users may have to restart X. Ouch! Is this true? The alter_group command indicates that you need to be an su to alter the group database. Does this mean that my serial port users need a database su able person to use serial port applications under RXTX? If so, what is the procedure to make a transparent install work using Java web start? Should I be prompting users for the su password? Should I be telling users to exit from X and log out? Is this the way other serial communications programs work? Thanks! - Doug From sean_montgomery at baseview.com Tue Jun 7 08:14:51 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 7 Jun 2005 10:14:51 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: >>> http://java.sun.com/products/javacomm/javadocs/javax/comm/package- >>> summary.ht >>> > > >> >> I'm prety sure it was there... but not anymore. >> >> > > It is there. Maybe the URL got mangled. Try this > > http://tinyurl.com/8dfp7 > > It just redirects you to: > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > summary.html > Maybe the issue here is that the info is available without frames from that URL, but when you try to access it with frames (from the link on that page) it doesn't work - it takes you to: http://java.sun.com/products/javacomm/javadocs/index.html Which doesn't have anything useful on it. From gadelavega at yahoo.com.ar Tue Jun 7 08:22:50 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:22:50 -0300 (ART) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: Message-ID: <20050607142251.92850.qmail@web14626.mail.yahoo.com> --- "Dr. Douglas Lyon" escribi?: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the > group > alter did not take until after I logged out and > logged back in. > > My theory is that you need permission to write to > the var/spool > directory under fedora and that this is the only way > to do it. > > Logging out and logging back in just seems like an > odd thing to > do. I suppose some users may have to restart X. > Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port > applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log > out? > Is this the way other serial communications programs > work? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Actually, you need the lock group to acces /var/lock directory, and uucp to acces /dev/ttyS*. You (as root) shuold add all users you will allow to use the serial ports to group uucp and all the ones you'll allow to lock the ports to lock group (rxtx needs both). This is not only for rxtx, but for any use of the serial ports. Next time they login they'll be able to work, so if they are in they'll have to log out first. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From gadelavega at yahoo.com.ar Tue Jun 7 08:23:56 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:23:56 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> Message-ID: <20050607142356.93815.qmail@web14624.mail.yahoo.com> --- Sean Montgomery escribi?: > > On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: > > >>> > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > >>> summary.ht > >>> > > > > > >> > >> I'm prety sure it was there... but not anymore. > >> > >> > > > > It is there. Maybe the URL got mangled. Try this > > > > http://tinyurl.com/8dfp7 > > > > It just redirects you to: > > > > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > > summary.html > > > > Maybe the issue here is that the info is available > without frames > from that URL, but when you try to access it with > frames (from the > link on that page) it doesn't work - it takes you > to: > > http://java.sun.com/products/javacomm/javadocs/index.html > > Which doesn't have anything useful on it. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > That's right, my bad. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From jon.nall at gmail.com Tue Jun 7 08:33:40 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 09:33:40 -0500 Subject: [Rxtx] performance expectations Message-ID: Hi all. I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC microcontroller. The protocol I'm using (which I didn't create) looks like this for the section of code I'm concerned with: PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data PIC -> PC: 0x01 // ACK 0xNN // First 8 bits of data 0xMM // Second 8 bits of data I issue ~2000 of these Read commands. The PIC itself has an input fifo which can store 18 bytes, so I can have 18 read commands in flight at a given time. The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k 8N1. I am measuring the time it takes to perform these 2000 commands at around 30 seconds, which is much longer than I anticipated. With the link fully utilized, I expected: Time per byte transmitted: 115200 / 8 = 14400 bytes/second = ~70 uS/byte Time per response transmitted: ~70 uS/byte * 3 bytes/response = ~210 uS/response Time for 2000 responses to be transmitted: ~210 uS/response * 2000 responses = ~420ms I'm a bit new to this, so I may have made some bad asumptions, but I would have expected a time of a couple of seconds to perform the 2000 reads, not 30+ seconds. I'm obviously missing something here. Can someone help me understand what's going on? Thanks, nall. From taj at www.linux.org.uk Tue Jun 7 09:17:48 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:17:48 +0100 (BST) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the group > alter did not take until after I logged out and logged back in. > > My theory is that you need permission to write to the var/spool > directory under fedora and that this is the only way to do it. > > Logging out and logging back in just seems like an odd thing to > do. I suppose some users may have to restart X. Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log out? > Is this the way other serial communications programs work? > RIght now, rxtx requires you do one of two things. 1) Use lock files (recommended). This requires intervention by the root users to allow users to create lock files and open the ports as you note. 2) configure rxtx with --disable-lockfiles. In this case you need only worry about the permissions on /dev/ttyS* I'm not sure what the default on Fedora is with respect to permisions. This is not very attractive. There is a better way it could be done on Fedora. Fedora comes with lockdev library. I've been considering this for some time. We could use that for the locking and do away with many of the problems. The problem is embeded devices running Linux do not come with liblockdev. But for your use, I would consider adding a new option for locking serial devices using liblockdev. lockdev-devel has a man page with further information. SYNOPSIS #include pid_t dev_testlock( const char * devname); pid_t dev_lock( const char * devname); pid_t dev_relock( const char * devname, pid_t pid); pid_t dev_unlock( const char * devname, pid_t pid); cc [ flag ... ] file ... -llockdev [ library ] This would probably need to be a configure time option to prevent problems on embeded Linux devices but could otherwise be the default on Linux. I could toss a quick patch together if this is confusing. It is actually easier than what rxtx does now. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 09:27:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:27:11 +0100 (BST) Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > Hi all. > I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC > microcontroller. The protocol I'm using (which I didn't create) looks like this > for the section of code I'm concerned with: > > PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data > PIC -> PC: 0x01 // ACK > 0xNN // First 8 bits of data > 0xMM // Second 8 bits of data > > I issue ~2000 of these Read commands. The PIC itself has an input fifo which > can store 18 bytes, so I can have 18 read commands in flight at a given time. > The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k > 8N1. > > I am measuring the time it takes to perform these 2000 commands at around 30 > seconds, which is much longer than I anticipated. With the link fully utilized, > I expected: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte > > Time per response transmitted: > ~70 uS/byte * 3 bytes/response = ~210 uS/response > > Time for 2000 responses to be transmitted: > ~210 uS/response * 2000 responses = ~420ms > > I'm a bit new to this, so I may have made some bad asumptions, but I would have > expected a time of a couple of seconds to perform the 2000 reads, not 30+ > seconds. > > I'm obviously missing something here. Can someone help me understand what's > going on? > I've hooked rxtx in loopback with a scope in the past at 9600 baud (baud rate is not important). Using event notification and just writing a byte on event/read the latencey was around 8-12 ms. The JNI is not an efficient way to use native code - especially for bit banging. So if timing is critical you want to move some of the logic into the native code rather than banging over the JNI. 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your performance. C# has advantages here. If you move your logic into the native layer or use gcj (rxtx will work with that too) most of your latency should vanish. You may have to play with some sleeps in eventLoop at that point to get full native efficiency. With gcj all of rxtx becomes 'native code' as java is just treated as a subset of C++. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 09:38:51 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 10:38:51 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: On 6/7/05, Jon Nall wrote: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte of course that should be divided by 10 to account for the start/stop bits, but it barely changes the end results. From carobizar at free.fr Tue Jun 7 10:21:29 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 7 Jun 2005 18:21:29 +0200 Subject: [Rxtx] (no subject) Message-ID: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Hello ! I am a french student and I have to create an application able to read and write on serial and parallel port and to run on Windows and Linux. For the moment my program run on Windows thanks the Java Communication API (version for Microsoft Windows and Solaris/x86). But it doesn't work on Linux. Does a recent version of an installation documentation exist ? I didn't find one on the RXTX site (nothing for the windows installation and the linux installation deals with a "jcl.jar" that I don't know...). So, I have some questions : 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 version or Linux&w32 version ?) What are the differences between them ? Which of them are the most stable ? 2) Where have I to put the .so and .dll files ? 3) What have I to write on the file javax.comm.properties ? 4) Have I to delete the file win32comm.dll included in the Java Comm API ? 5) Have I to keep both comm.jar and RXTXcomm.jar ? Best regards, Caroline. From debief at telemsa.com Tue Jun 7 10:44:56 2005 From: debief at telemsa.com (DEBIEF Eric) Date: Tue, 7 Jun 2005 18:44:56 +0200 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: <200506071844.56656.debief@telemsa.com> Hi, We are "pushing" RxTx /Java here in a half-duplex link. The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC and application handling) about 25?s/byte. The figures are the barely the same on two environments. Environment 1 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Linux 2.6.3, Mdk 10.0. RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : bytes are lost on the wire. I need to investigate this mystery.... Java : 1.4.2-rc1 Blackdown Environment 2 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Windows 2000 Pro RxTx : 2.0.7. Java : 1.4.2_08 SUN I Hope this help, Eric. _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 7 11:05:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:05:45 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, DEBIEF Eric wrote: > Hi, > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. How many write() calls is this? > > Environment 1 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Linux 2.6.3, Mdk 10.0. > RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : > bytes are lost on the wire. I need to investigate this mystery.... > Java : 1.4.2-rc1 Blackdown > > Environment 2 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Windows 2000 Pro > RxTx : 2.0.7. > Java : 1.4.2_08 SUN > In my event/read/write test I found windows was ~20% faster than linux for some reason (strange part is Windows was in VMWare on the same Linux machine). It was about the same rxtx version. There are many problems with rxtx 1.4 with respect to commapi on windows but its code paths are more simple. What some people want from rxtx is perhaps better served by hacking up the very first release as they just want to read and write which is what rxtx was before Sun released commapi. It sounds like perhaps you are pushing out larger writes which will greatly improve results. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 11:16:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:16:49 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118161289.42a5c989cf6a2@imp4-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: On Tue, 7 Jun 2005 carobizar at free.fr wrote: > > Hello ! > > I am a french student and I have to create an application able to read and write > on serial and parallel port and to run on Windows and Linux. > For the moment my program run on Windows thanks the Java Communication API > (version for Microsoft Windows and Solaris/x86). > But it doesn't work on Linux. > > Does a recent version of an installation documentation exist ? > I didn't find one on the RXTX site (nothing for the windows installation and the > linux installation deals with a "jcl.jar" that I don't know...). > > So, I have some questions : > > 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 > version or Linux&w32 version ?) What are the differences between them ? Which > of them are the most stable ? > Use rxtx 2.0 with commapi for sparc solaris from Sun. If you want your current package javax.comm. > 2) Where have I to put the .so and .dll files ? On Linux just use the source, the configure script will do all of that for you. tar -xzvf rxtx-2.0-version mkdir rxtx-2.0-version/build cd rxtx-2.0-version/build ../configure && make install It will do everything for you. With Windows, you need to create the javax.comm.properties and install the DLL on your path. But you can just use Sun's package too. They are intended to be interchangable. > > 3) What have I to write on the file javax.comm.properties ? Driver=gnu.io.RXTXCommDriver More documentation in INSTALL that comes with the source. Sun's documentation should work too. configure does this for you on Linux. > > 4) Have I to delete the file win32comm.dll included in the Java Comm API ? > No > 5) Have I to keep both comm.jar and RXTXcomm.jar ? > Yes. RXTX 2.1 replaces comm.jar but the package is different (gnu.io) to avoid contaminating Sun's namespace. With rxtx 2.0 you need Sun's comm.jar - they work together. > > Best regards, > Caroline. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Tue Jun 7 12:07:34 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 14:07:34 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 Message-ID: <20050607180632.1543A29D5C8@mail.electronpusher.org> Hello, I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our product includes a built in USB to Serial adapter so that when it is connected to your PC over USB, it appears as a serial port. We had problems with Sun's comm library because it did not detect serial ports coming and going properly. I did run into a few issues with RxTx though. I am building under Windows (we support XP and 2000) under cygwin. I used a simple make file for the c code that works under cygwin and ant to build the java stuff. Attached is a diff file. The patches hit the following issues: ParallelImp.c - I am not using config so there is no config.h for me. Also, gcc didn't like a local file (win32termios.h) getting included with <> . RXTXPort.java - You can get an exception during the writeByte, writeArray, nativeDrain, readByte, read, readArray, readTerminatedArray, and nativeAvailable calls. Without this patch the IOLocked count gets stuck incremented. termios.c - If you try to open a port through CreateFile and get ERROR_ACCESS_DENIED it means someone else is using the port. We need to make sure to use serial_close instead of just close. I found that some devices finish their I/O synchronously. The code was treating this as an error. I also added some checking on the ClearError calls. I found a compile error when debugging is turned on (see the usleep change). SerialImp.c - Again, I don't have a config.h and again we must use quotes and not <> to include win32termios.h . I also commented out a report call since it seems to happen constantly on my system. Feel free to use these in any way that you want or just to ignore them. Thanks! -Dave Acker dacker at nomadio.net Software Engineer Nomadio, Inc. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diffs.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/5671d159/diffs-0393.txt From jon.nall at gmail.com Tue Jun 7 12:28:16 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 13:28:16 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, DEBIEF Eric wrote: > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. Hi. This is helpful, thanks. I can think of 2 reasons I'm not collecting the data as fast as I think I should be: 1) the device to PC connection is not at 100% utilization 2) my SerialPortEventListener processing has too much overhead Are there other explanations I might be missing as to why it takes so long to transfer the data? Thanks. nall. From taj at www.linux.org.uk Tue Jun 7 13:21:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:21:46 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > On 6/7/05, DEBIEF Eric wrote: > > We are "pushing" RxTx /Java here in a half-duplex link. > > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > > and application handling) about 25?s/byte. > > The figures are the barely the same on two environments. > > Hi. > This is helpful, thanks. I can think of 2 reasons I'm not collecting > the data as fast as I think I should be: > 1) the device to PC connection is not at 100% utilization > 2) my SerialPortEventListener processing has too much overhead > > Are there other explanations I might be missing as to why it takes so > long to transfer the data? > Polling the port would probably make more sense. You can set the threshold/timeouts to avoid racing and not deal with the event notification. As mentioned earlier I think the event latency is ~10ms. Keep the event listener around, rxtx 2.* does not close well without it. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 13:27:27 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 14:27:27 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, Trent Jarvi wrote: > Polling the port would probably make more sense. You can set the > threshold/timeouts to avoid racing and not deal with the event > notification. As mentioned earlier I think the event latency is ~10ms. Trent, Thanks for the response. Just to make sure I understand what you're talking about, when you say event latency, do you mean the time it takes from when the byte hits the PC's comm port to when rxtx presents it to user code? So if the link is 100% utilized, will my user code see "hiccups" or a steady stream of data? Thanks for helping a serial port newbie. nall. From dacker at nomadio.net Tue Jun 7 13:32:20 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 15:32:20 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <20050607193118.5499329CAA0@mail.electronpusher.org> Some folks asked about the make file and ant steps. I have JAVA_HOME set as follows: $ echo $JAVA_HOME C:\Program Files\Java\jdk1.5.0_01 I have all the code in rxtx/src put into gnu/io . The make file here doesn't have optimizations turned on. We have not tested with it yet. --------------Begin Makefile------------------ CPPFLAGS="-I$(JAVA_HOME)/include" "-I$(JAVA_HOME)/include/win32" SOBJECTS=SerialImp.o fuserImp.o termios.o fixup.o init.o POBJECTS=ParallelImp.o termios.o init.o DLLS=rxtxParallel.dll rxtxSerial.dll all: $(CLASSES) $(DLLS) rxtxSerial.dll: $(SOBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(SOBJECTS) rxtxParallel.dll: $(POBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(POBJECTS) clean: rm -fv $(SOBJECTS) $(POBJECTS) $(DLLS) %.o: %.c gcc -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< %.o: %.cpp g++ -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< --------------End Makefile------------------ Here is the ant target I use to build the rxtx libs. Our build puts the class files in a bin dir. We copy the dlls to a deploy dir and to the build dir. Eclipse seems to like the dlls in the build dir. The deploy dir is used when we build our full package. --------------Begin Ant Section------------------ --------------End Ant Section------------------ > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > David S. Acker > Sent: Tuesday, June 07, 2005 2:08 PM > To: 'Java RXTX discussion' > Subject: [Rxtx] Patches to 2.1-7pre17 > > Hello, > I am using RxTx with the Nomadio Sensor, > http://www.nomadio.net/ . Our product includes a built in > USB to Serial adapter so that when it is connected to your PC > over USB, it appears as a serial port. We had problems with > Sun's comm library because it did not detect serial ports > coming and going properly. > > I did run into a few issues with RxTx though. I am building > under Windows (we support XP and 2000) under cygwin. I used > a simple make file for the c code that works under cygwin and > ant to build the java stuff. Attached is a diff file. The > patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h > for me. Also, gcc didn't like a local file (win32termios.h) > getting included with <> . > > RXTXPort.java - You can get an exception during the > writeByte, writeArray, nativeDrain, readByte, read, > readArray, readTerminatedArray, and nativeAvailable calls. > Without this patch the IOLocked count gets stuck incremented. > > termios.c - If you try to open a port through CreateFile and > get ERROR_ACCESS_DENIED it means someone else is using the > port. We need to make sure to use serial_close instead of > just close. I found that some devices finish their I/O > synchronously. The code was treating this as an error. I > also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we > must use quotes and not <> to include win32termios.h . I > also commented out a report call since it seems to happen > constantly on my system. > > Feel free to use these in any way that you want or just to > ignore them. > Thanks! > > -Dave Acker > dacker at nomadio.net > Software Engineer > Nomadio, Inc. > From taj at www.linux.org.uk Tue Jun 7 13:37:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:37:45 +0100 (BST) Subject: [Rxtx] Re: Stack Smashing Attack In-Reply-To: <200506072012.48860.ferdinand.tatzig@web.de> References: <200506072012.48860.ferdinand.tatzig@web.de> Message-ID: On Tue, 7 Jun 2005, Ferdinand Tatzig wrote: > Dear Trent > > I am using RXTX for serial port communication between a PC and a payment > transaction terminal. > When I run my application under Windows 2000, an i386-Linux or an i386-FreeBSD > it works as I expect it to do. However, when I start it to run on AMD64 > machine with a 64-bit Gentoo Linux, the VM terminates with the following > error: > > Port found: /dev/ttyS0 > java: stack smashing attack in function configure_port() > > I am using a 64-bit Blackdown-1.4.2-01 VM. > > I have searched the internet but have found no information about this error. > > This is the code of the method which initializes the serial port: > > /** > * initializes a serial port for communication with a terminal; only > * accessible within this class > * > * @param communication > * @param serialPortToBeInitialized > * @param tillInterfaceEventListener > */ > private TillInterfaceSerialPort(Communication communication, > String serialPortToBeInitialized, > TillInterfaceEventListener tillInterfaceEventListener) > throws IOException, PortInUseException, > TillInterfaceSerialPortNotFoundException, > TooManyListenersException, UnsupportedCommOperationException { > serialPortName = "not initialized yet"; > CommPortIdentifier portId = null; > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > boolean portFound = false; > String temporarySerialPortName = "not initialized yet"; > > // look for a serial port > while (portList.hasMoreElements() && !portFound) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > temporarySerialPortName = portId.getName(); > if (temporarySerialPortName.equals(serialPortToBeInitialized)) { > System.out.print("Port found: "); > System.out.println(temporarySerialPortName); > serialPortName = temporarySerialPortName; > portFound = true; > } > } > } > if (portFound) { > > // initialize the found port - this command causes the VM to terminate > serialPort = (SerialPort) portId > .open( > TillInterfaceConstants.APPLICATION_NAME, > TillInterfaceConstants > .TIMEOUT_IN_MILLISECONDS_FOR_OPENING_OF_COMMUNICATION_PORT); > > // add an event listener which listens > // on the serial port and notifies the > // serial port object when input bytes > // have been received at the port > serialPort.addEventListener(tillInterfaceEventListener); > serialPort.notifyOnDataAvailable(true); > > // initialize the physical layer > // parameters of the serial port > serialPort.setSerialPortParams(TillInterfaceConstants.BAUD_RATE, > SerialPort.DATABITS_8, SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > // set the inter-character > // timeout (T2) > serialPort > .enableReceiveTimeout(TillInterfaceConstants.INTERCHARACTER_TIMEOUT_IN_MILLISECONDS); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > } else > throw new TillInterfaceSerialPortNotFoundException(); > } > > Any hint to solve this problem would be kindly appreciated. > The only thing that comes to mind here after looking at the offending function is rxtx used to include asm/termios.h but now we moved to termios.h and had glibc fix their headers. The asm/termios.h caused problems as its termios was smaller than the actual termios. This should be fixed in current rxtx versions but you can just glance at SerialImp.c and make sure it does not include asm/termios.h. I've cc'd the rxtx mail list because there was one other mention of stack problems recently. I have used rxtx on opteron systems with success. I have a bug I'm trying hard to reproduce on suse 64 bit (circa linux 2.4.19) systems though. So far I have not been able to reproduce the bug. That said, with gentoo... I like gentoo but I seriously doubt they do any QA with their kernel and Java. I've seen problems before. If you use gentoo and have Java problems, at least stick to Linus (that is an s there) kernels while using Java. I'm not an expert on gentoo but I've seen patches go into experimental kernels that turn out to break java and are reverted before going to Linus just before I see problems with gentoo on this list. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:16:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:16:14 +0100 (BST) Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: On Tue, 7 Jun 2005, David S. Acker wrote: > Hello, > I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our > product includes a built in USB to Serial adapter so that when it is > connected to your PC over USB, it appears as a serial port. We had problems > with Sun's comm library because it did not detect serial ports coming and > going properly. > > I did run into a few issues with RxTx though. I am building under Windows > (we support XP and 2000) under cygwin. I used a simple make file for the c > code that works under cygwin and ant to build the java stuff. Attached is a > diff file. The patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h for me. Also, > gcc didn't like a local file (win32termios.h) getting included with <> . > > RXTXPort.java - You can get an exception during the writeByte, writeArray, > nativeDrain, readByte, read, readArray, readTerminatedArray, and > nativeAvailable calls. Without this patch the IOLocked count gets stuck > incremented. > > termios.c - If you try to open a port through CreateFile and get > ERROR_ACCESS_DENIED it means someone else is using the port. We need to > make sure to use serial_close instead of just close. I found that some > devices finish their I/O synchronously. The code was treating this as an > error. I also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we must use quotes > and not <> to include win32termios.h . I also commented out a report call > since it seems to happen constantly on my system. > > Feel free to use these in any way that you want or just to ignore them. > Thanks! > Hi Dave These patches look great as is. Thanks. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:33:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:33:16 +0100 (BST) Subject: [Rxtx] Patch to IOLocked (fwd) Message-ID: This appears to be another solution to the locking. Chris, the other option just moves the locking into the finally clause which I think would be a little cleaner though I'm posting this patch to so people can comment. -- Trent Jarvi tjarvi at qbang.org ---------- Forwarded message ---------- Date: Wed, 1 Jun 2005 13:01:32 +0100 From: Christopher Dawes To: taj at www.linux.org.uk Subject: Patch to IOLocked Do you want me to check it out of CVS and then submit changes? Christopher -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXPort.java.diff Type: application/octet-stream Size: 6965 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/c442f9fc/RXTXPort.java-0396.obj From Christopher.Dawes at retail-logic.com Wed Jun 8 00:57:24 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 8 Jun 2005 07:57:24 +0100 Subject: [Rxtx] Patch to IOLocked (fwd) [Virus Checked] In-Reply-To: Message-ID: Agreed, much better Java :-) Thanks Christopher ------------------------------------------- Consultant Engineer Retail Logic Limited Fleet GU51 3TZ Tel: +44 (0)1252 644377 Mob: +44 (0)7899 842759 Fax: +44 (0)1252 776708 rxtx-bounces at mail.electronpusher.org wrote on 07/06/2005 21:33:16: > > This appears to be another solution to the locking. Chris, the other > option just moves the locking into the finally clause which I think would > be a little cleaner though I'm posting this patch to so people can > comment. > > -- > Trent Jarvi > tjarvi at qbang.org > > ---------- Forwarded message ---------- > Date: Wed, 1 Jun 2005 13:01:32 +0100 > From: Christopher Dawes > To: taj at www.linux.org.uk > Subject: Patch to IOLocked > > Do you want me to check it out of CVS and then submit changes? > > Christopher[attachment "RXTXPort.java.diff" deleted by Chris > Dawes/Retaillogic/NISABA] _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx From zempftman at gmail.com Wed Jun 8 07:57:25 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 09:57:25 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Maxwell Zempftman Date: May 27, 2005 5:01 PM Subject: Re: [Rxtx] Kaffe & rxtx & armv5b To: rxtx at mail.linuxgrrls.org Here are the results from working this week: The "NullPointerExceptions" are generated by the software when I choose a bad device file. I discovered that this occurs on the i686-RedHat box as well. This exception seems to be generated only by this particular application, and not by the example programs in contrib. So, for example: java MyApp /dev/null <-- generates NullPointerException java MyApp fake <-- generates NullPointerException java MyApp /dev/ttyS0 <-- does not generate NullPointerException Using the program CommCheck (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it appears as though /dev/ttyS0 is the only valid serial device file on the XScale device, so the errors I was getting are not really be bugs. Although /dev/ttyS0 did not generate NullPointerExceptions, I did encounter this error: --start java MyApp /dev/ttyS0 (going mostly from memory, not exact) PortList.hasMoreElements: true Listening on: /dev/ttyS0 Client connected. >From net: echo kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 vmExcept_setJNIFrame Assert: on 'fp != 0' failed. --end I took a look at exception.h, and it seems as though the problematic code does not exist in newer versions of Kaffe (I have been using CVS-2004-11). Next week I will try to use a newer version, although so far everything but CVS-2004-11 has failed. Also, I the device files I need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with something like this? Thanks, Max. > On 5/21/05, Trent Jarvi wrote: > > I'm not sure what is wrong in the first part. It sounds like your > > application may be swallowing an exception while trying to enumerate the > > port or open it. The usual mistake made it not having permissions to > > either open the port or create the lockfile. There should be examples in > > the contrib directory you can try that enumerate and open ports. Maybe > > that will give you some hints. > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > Sun's code limiting you there though you do need to compile and install > > rxtx for the XScale with Sun's Commapi. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > From taj at www.linux.org.uk Wed Jun 8 08:22:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 15:22:44 +0100 (BST) Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > ---------- Forwarded message ---------- > From: Maxwell Zempftman > Date: May 27, 2005 5:01 PM > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > To: rxtx at mail.linuxgrrls.org > > > Here are the results from working this week: > > The "NullPointerExceptions" are generated by the software when I > choose a bad device file. I discovered that this occurs on the > i686-RedHat box as well. This exception seems to be generated only by > this particular application, and not by the example programs in > contrib. So, for example: > > java MyApp /dev/null <-- generates NullPointerException > java MyApp fake <-- generates NullPointerException > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > Using the program CommCheck > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > appears as though /dev/ttyS0 is the only valid serial device file on > the XScale device, so the errors I was getting are not really be bugs. > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > encounter this error: > > --start > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > PortList.hasMoreElements: true > Listening on: /dev/ttyS0 > Client connected. > >From net: echo > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > --end > > I took a look at exception.h, and it seems as though the problematic > code does not exist in newer versions of Kaffe (I have been using > CVS-2004-11). Next week I will try to use a newer version, although so > far everything but CVS-2004-11 has failed. Also, I the device files I > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > something like this? > In RXTXCommDriver, just look for the following code and add /dev/ttyM to the list. Moxa? if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } So: if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyM", // for Moxa ports "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } Linux just has way too many port types to try enumerating them all. There is potential we can add them back in with udev now. > Thanks, > Max. > > > On 5/21/05, Trent Jarvi wrote: > > > I'm not sure what is wrong in the first part. It sounds like your > > > application may be swallowing an exception while trying to enumerate the > > > port or open it. The usual mistake made it not having permissions to > > > either open the port or create the lockfile. There should be examples in > > > the contrib directory you can try that enumerate and open ports. Maybe > > > that will give you some hints. > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > Sun's code limiting you there though you do need to compile and install > > > rxtx for the XScale with Sun's Commapi. > > > > > > -- > > > Trent Jarvi > > > tjarvi at qbang.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Wed Jun 8 12:16:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 08 Jun 2005 13:16:03 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A60B8D.8080500@cs.umn.edu> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> Message-ID: <42A735E3.8040706@atcorp.com> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual serial comport. This isn't so much of a problem, what is, however, is that the comport does not appear to be able to be set to any arbitrary speed, only those from the data_rate enum. I've not found much on using different speeds, has anyone else encountered anything similar? I greatly appreciate any and all comments and suggestions. Thanks in advance, ~ Shawn Lavelle From zempftman at gmail.com Wed Jun 8 12:50:58 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 14:50:58 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: Thanks Trent! That will solve one of the problems. I don't know when my next chance to work on it will be, but I still need to figure out the error I got when I tried opening '/dev/ttyS0' on the Moxa device regarding a failed assertion, seemed to be a Kaffe issue. Thanks for you help, hope to have results soon, Max Englander. On 6/8/05, Trent Jarvi wrote: > On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > > > ---------- Forwarded message ---------- > > From: Maxwell Zempftman > > Date: May 27, 2005 5:01 PM > > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > > To: rxtx at mail.linuxgrrls.org > > > > > > Here are the results from working this week: > > > > The "NullPointerExceptions" are generated by the software when I > > choose a bad device file. I discovered that this occurs on the > > i686-RedHat box as well. This exception seems to be generated only by > > this particular application, and not by the example programs in > > contrib. So, for example: > > > > java MyApp /dev/null <-- generates NullPointerException > > java MyApp fake <-- generates NullPointerException > > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > > > Using the program CommCheck > > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > > appears as though /dev/ttyS0 is the only valid serial device file on > > the XScale device, so the errors I was getting are not really be bugs. > > > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > > encounter this error: > > > > --start > > > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > > > PortList.hasMoreElements: true > > Listening on: /dev/ttyS0 > > Client connected. > > >From net: echo > > > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > > > --end > > > > I took a look at exception.h, and it seems as though the problematic > > code does not exist in newer versions of Kaffe (I have been using > > CVS-2004-11). Next week I will try to use a newer version, although so > > far everything but CVS-2004-11 has failed. Also, I the device files I > > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > > something like this? > > > > > In RXTXCommDriver, just look for the following code and add /dev/ttyM to > the list. Moxa? > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > So: > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyM", // for Moxa ports > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > Linux just has way too many port types to try enumerating them all. There > is potential we can add them back in with udev now. > > > > > Thanks, > > Max. > > > > > On 5/21/05, Trent Jarvi wrote: > > > > I'm not sure what is wrong in the first part. It sounds like your > > > > application may be swallowing an exception while trying to enumerate the > > > > port or open it. The usual mistake made it not having permissions to > > > > either open the port or create the lockfile. There should be examples in > > > > the contrib directory you can try that enumerate and open ports. Maybe > > > > that will give you some hints. > > > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > > Sun's code limiting you there though you do need to compile and install > > > > rxtx for the XScale with Sun's Commapi. > > > > > > > > -- > > > > Trent Jarvi > > > > tjarvi at qbang.org > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- > Trent Jarvi > tjarvi at qbang.org > From taj at www.linux.org.uk Wed Jun 8 12:53:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 19:53:10 +0100 (BST) Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A735E3.8040706@atcorp.com> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: On Wed, 8 Jun 2005, Shawn Lavelle wrote: > Hello, > I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate > with a virtual serial comport. This isn't so much of a problem, what > is, however, is that the comport does not appear to be able to be set to > any arbitrary speed, only those from the data_rate enum. I've not found > much on using different speeds, has anyone else encountered anything > similar? I greatly appreciate any and all comments and suggestions. > This problem is a bit more tricky than it should be. POSIX systems just have a few specified baud rates. Solaris is one of these systems. CommAPI baud rates probably came from someone looking at Solaris. RXTX tries to be POSIX like. W32 is treated as a POSIX like system via a termios.c file in rxtx. Serial ports have baudbase and divisor. So you can set these to come close to the baudrate you want. Some funky equipment like automobile test equipment use baud rates that are not really possible with PC hardware. But if you get as close as possible by changing baud base and divisor, it works. Windows can actually do this for you. I don't know exactly what their code does but if you pass a baudrate to windows, it will guestimate a baudbase and divisor. So you just pass it 10200 baud and it does its job. This is not of very much use the way rxtx does things though. Linux has the standard POSIX like baud rates but if you set the baud rate to B38400, you can set your own baud base and divisor. This is not POSIX that I know of. W32 has more capability than POSIX like systems too. So I did some work to have windows work like Linux via termios.c But the code is not quit right. SerialImp.c and termios.c need some work so all the various buadrates work on Linux and W32. Most other systems will not work beyond what CommAPI already specifies without writting kernel drivers. This is on my todo list but if someone gets to it first, all the better. -- Trent Jarvi tjarvi at qbang.org From carobizar at free.fr Thu Jun 9 06:39:10 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Thu, 9 Jun 2005 14:39:10 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: <1118320750.42a8386e6d3ce@imp5-q.free.fr> Hi ! Thank you for all your advices. I managed to use rxtx on Windows but I have still some difficulties on Linux. I have yet follow your instructions and the configure file has created : - librxtxSerial.so and librxtxParallel.so in the directory /usr/java/j2sdk1.4.2_08/jre/lib/i386 - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the directory /usr/java/j2sdk1.4.2_08/jre/lib - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext But when I run my program, Some exceptions occur : Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver So, 1) What have I forgotten ? 2) Is it possible to make my application run on Linux without the jdk (only the jre) ? Best regards, Caroline. From taj at www.linux.org.uk Thu Jun 9 07:28:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 9 Jun 2005 14:28:05 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118320750.42a8386e6d3ce@imp5-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: On Thu, 9 Jun 2005 carobizar at free.fr wrote: > Hi ! > Thank you for all your advices. > I managed to use rxtx on Windows but I have still some difficulties on Linux. > I have yet follow your instructions and the configure file has created : > - librxtxSerial.so and librxtxParallel.so in the directory > /usr/java/j2sdk1.4.2_08/jre/lib/i386 > - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the > directory /usr/java/j2sdk1.4.2_08/jre/lib > - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext > > But when I run my program, Some exceptions occur : > Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while > loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > com.sun.comm.SolarisDriver > > So, > 1) What have I forgotten ? > The native (.so) libraries are not installed in a directory the JRE is looking for native libraries in. You may look around and see where the .so libraries are in the JRE. I don't know that the jre/lib/i386 directory is specified as a required directory for JREs. I noticed some do not use it. You may try printing the java.libarary.path to see your options. It is also possible to alter the java.library.path. > 2) Is it possible to make my application run on Linux without the jdk (only the > jre) ? Yes. Though installation from source with the JDK is less error prone. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0393.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 7 15:03:09 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 07 Jun 2005 16:03:09 -0500 Subject: [Rxtx] Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <42A60B8D.8080500@cs.umn.edu> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual comport. This isn't so much of a problem, what is, however, is that the comport is only ever set to 9600 baud. I've not found this as a documented bug, has anyone else encountered anything similar? I'll try and provide more detail tomorrow, but if anyone has any suggestions or encountered this before, I'd like to hear about it. Thanks in advance, ~ Shawn Lavelle From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0396.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0396.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0396.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Mon Jun 20 01:04:40 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 20 Jun 2005 08:04:40 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: <42B66A88.4060806@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050620/9be208a1/attachment-0396.html From fbalzarro at libero.it Mon Jun 20 02:33:52 2005 From: fbalzarro at libero.it (Fabio Balzarro) Date: Mon, 20 Jun 2005 10:33:52 +0200 Subject: [Rxtx] RXTXPort:close detected bad file descriptor Message-ID: I'm using RXTX libraries on IPAQ 4150 PDA with Windows CE 4.20 and Jeode. When I close a serial port with sp.close() (where sp is a SerialPort) sometimes an error occour 1119256168085: RXTXPort:close detected bad file descriptor What can I do? Thanks Fabio ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From slavelle at atcorp.com Mon Jun 20 08:08:19 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 20 Jun 2005 09:08:19 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: <42B6CDD3.4040409@atcorp.com> It turns out that I did have a driver-not-used issue which has now been resolved and I can use RxTx on it (had to add ttyUSB as a valid port), but only at standard baud rates. Does USB have the same restrictions on port speed as regular RS232? ~ Shawn Trent Jarvi wrote: > Just a note here. > > I have requested a FTDI usb device and they offered to send one for the > purpose of trying to get rxtx working. I have no idea how long that takes > though. > > > On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > > >>I'm afraid we're just using the latest version from the FTDI website. I've >>not yet played with linux properly with this and unfortunately I run gentoo >>and haven't yet successfully compiled in the ftdi driver. I'll let you know >>if I get any success. >> >>Appologies >> >>Christopher >> >>-----Original Message----- >>From: rxtx-bounces at mail.electronpusher.org >>[mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle >>Sent: 15 June 2005 00:00 >>To: Java RXTX discussion >>Subject: Re: [Rxtx] Virtual Com Ports >> >>Hmm, the latter sounds like a lot of work. It does find the virtual comport >>in windows, i must have just missed it earlier (sign of a long day). On the >>linux side, I suspect that something is not correct with the driver >>installation becuase it does not give me a tty for it :( >> >>Christopher, May I ask what driver you are using for your FTDI chip? >>Did you ever encounter problems with not getting a tty assigned for it? >> >> >> Thanks for all your help! >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>They will have to show up as a tty device in Linux. Probably ttyUSB? >>>That will need an entry in RXTXCommDriver.java. If they dont show up >>>as a tty device, rxtx cant treat it like a serial port. It just wont >> >>work. >> >>>With COM3, rxtx will try to open the port and perform a timed out read. >>>Usually if a port is not there, the read blows up or the open blows up. >>>Timing out is fine. COM3 used to share interrupts with COM1. I know >>>you can reassign ports in XP. RXTX scans up through COM255. You may >>>try moving it. >>> >>> >>>The code in question is the following in RXTXCommDriver.java >>> >>> >>> if(osName.equals("Linux")) >>> { >>> String[] Temp = { >>> "ttyS", // linux Serial Ports >>> "ttySA", // for the IPAQs >>> "ttyUSB" // for USB frobs >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>> else if(osName.toLowerCase().indexOf("windows") != -1 ) >>> { >>> String[] Temp = { >>> "COM" // win32 serial ports >>> //"//./COM" // win32 serial ports >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>>If COM3 can be read, it should be found. the ttyUSB should work if >>>thats in the version of RXTXCommDriver.java you have. >>> >>>If this is still a problem, it may be that the driver is erroring on >>>what may be considered normal comm port operations such as setting the >>>speed, timeout, threshold, .. One would have to start looking at each >>>function called in the native open() and read(). >>> >>> >>> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>>seems to find the device using rxtx. Looking at the hardware >>>>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>>>linux. I can't seem to get it to show up as a tty(s#) in linux which >>>>is probably just due to my lack of significant linux knowledge. >>>> >>>> ~ Shawn >>>> >>>>Trent Jarvi wrote: >>>> >>>> >>>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>Has anyone here noticed that virtual comports do not get enumerated >>>>>>via CommPortIdentifier.getPortIdentifiers()?? >>>>>> >>>>>>The device I'm trying to talk to uses an fdti usb to serial >>>>>>convertor with a driver that has it show up as a virtual comport. I >>>>>>can enter this port manually and it will be usable but I cannot get >>>>>>it show up automatically (as in the simple serial demo). Any thoughts >> >>on this? >> >>>>> >>>>>Hi Shawn, >>>>> >>>>>What OS is this and what is the name of the virtual port you are >>>>>trying to open? I suspect the name just needs to be added to >> >>RXTXCommDriver.java. >> >>>>_______________________________________________ >>>>Rxtx mailing list >>>>Rxtx at mail.electronpusher.org >>>>http://www.electronpusher.org/mailman/listinfo/rxtx >>>> >>> >>> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From lyon at docjava.com Mon Jun 20 15:06:08 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 20 Jun 2005 17:06:08 -0400 Subject: [Rxtx] testing Message-ID: Hi All, I am testing my new multi-platform Java Webstart RXTX application (Trent: I could not have done it without you!). So far, I think it will work under Linux (x86), Windows XP, Windows 2000 and MacOS X. The application is available as a Java webstart application at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Edit:Preferences: SerialPort Setup... should bring up a dialog box that enables dialing via the modem. Generally, it does not find internal modems (except on the mac). Why, I don't know. Thanks in advance for trying this new app. All feedback on it is welcome. - Doug Lyon From jasmine at electronpusher.org Tue Jun 21 04:15:53 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Tue, 21 Jun 2005 11:15:53 +0100 Subject: [Rxtx] testing In-Reply-To: References: Message-ID: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > Hi All, > I am testing my new multi-platform Java Webstart RXTX application > (Trent: I could not have done it without you!). > > So far, I think it will work under Linux (x86), Windows XP, > Windows 2000 and MacOS X. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. -J. From taj at www.linux.org.uk Tue Jun 21 05:50:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 12:50:23 +0100 (BST) Subject: [Rxtx] testing In-Reply-To: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> References: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> Message-ID: On Tue, 21 Jun 2005, Jasmine Strong wrote: > > On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > > > Hi All, > > I am testing my new multi-platform Java Webstart RXTX application > > (Trent: I could not have done it without you!). > > > > So far, I think it will work under Linux (x86), Windows XP, > > Windows 2000 and MacOS X. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > on my Mac. > passing -source 1.3 -target 1.3 to javac will compile classes without this problem. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 10:19:25 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 11:19:25 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. Sincerely, Jeremyah Payne From ricardo.trindade at emation.pt Tue Jun 21 13:25:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 20:25:00 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B8698C.2060509@emation.pt> Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > From taj at www.linux.org.uk Tue Jun 21 13:39:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:39:43 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <42B8698C.2060509@emation.pt> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> <42B8698C.2060509@emation.pt> Message-ID: It looks like he has an rs422 device/converter. This is not the problematic 'trying to do protocol X with a serial port' situation unless I'm missing something. I'll follow up with the other email I started. On Tue, 21 Jun 2005, Ricardo Trindade wrote: > Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. > > Payne, Jeremyah L (N-CIM) wrote: > > >Good morning, my name is Jeremyah and I am working on a java project to > >interface with some devices. In short, I have a laptop with a PCMIA > >converter that does RS422 running windows 2000. I also will be > >installing some PCI cards into some Linux boxes that will have probably > >4-8 RS422 ports on them. After doing some reading in order to talk > >with these items using my existing java code I will need an additional > >driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > >trying to get a map sort of where I need to make changes. As I see it, > >I would need to subclass SerialPort to my RS422 interface. That would > >link with a DLL or SO implementation that talks with the hardware. I > >also need to change the listing of working ports in the lookup section > >for serial. Does this seem like I am on the right track? Appreciate > >the support. > > > > > >Sincerely, > >Jeremyah Payne > >_______________________________________________ > >Rxtx mailing list > >Rxtx at mail.electronpusher.org > >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 21 13:40:25 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:40:25 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: On Tue, 21 Jun 2005, Payne, Jeremyah L (N-CIM) wrote: > Good morning, my name is Jeremyah and I am working on a java project to > interface with some devices. In short, I have a laptop with a PCMIA > converter that does RS422 running windows 2000. I also will be > installing some PCI cards into some Linux boxes that will have probably > 4-8 RS422 ports on them. After doing some reading in order to talk with > these items using my existing java code I will need an additional > driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > trying to get a map sort of where I need to make changes. As I see it, I > would need to subclass SerialPort to my RS422 interface. That would link > with a DLL or SO implementation that talks with the hardware. I also > need to change the listing of working ports in the lookup section for > serial. Does this seem like I am on the right track? Appreciate the > support. > Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 13:40:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 14:40:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618954@emss02m08.us.lmco.com> I'd like to except I am dealing with NASA. I am basically building a system to monitor 100+ Units that communicate over RS422. They have some converters in place but want to get rid of them. I'll check through the archives. I had started looking yesterday as was leaving work. -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Ricardo Trindade Sent: Tuesday, June 21, 2005 2:25 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From slavelle at atcorp.com Tue Jun 21 14:58:06 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 21 Jun 2005 15:58:06 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: <42B87F5E.4000403@atcorp.com> > Linux has the standard POSIX like baud rates but if you set the baud rate > to B38400, you can set your own baud base and divisor. This is not POSIX > that I know of. W32 has more capability than POSIX like systems too. So > I did some work to have windows work like Linux via termios.c > > But the code is not quit right. SerialImp.c and termios.c need some > work so all the various buadrates work on Linux and W32. Most other > systems will not work beyond what CommAPI already specifies without > writting kernel drivers. > > This is on my todo list but if someone gets to it first, all the better. Hmm, I guess I didn't read this close enough before. Just to be clear, the pieces to setBaudBase and setDivisor are not yet implemented, correct? Thanks, Shawn From sean_montgomery at baseview.com Tue Jun 21 15:14:08 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 21 Jun 2005 17:14:08 -0400 Subject: [Rxtx] OS X installation - file locations Message-ID: <8AB82C7F-0D19-45F9-AE54-A12C59A8495E@baseview.com> Greetings, I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) using the RXTX installation instructions. RXTX worked fine. Basically you've got: - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions - javax.comm.properties in /System/Library/Frameworks/ JavaVM.framework/Home/lib - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ lib/ext My coworker was concerned that the installation required files to be placed in /System/Library... because those directories are "Apple's" and subject to change at Apple's whim, and that it would be safer (less likely to break when a user updates their OS or Java version or what have you) if all the files could be somewhere in /Library... or / Library/Java. My coworker points out that when 3rd party apps like FrontBase and JBoss need to communicate with Java their jars are placed in /Library/Java/Extensions. Granted that RXTX 2.0 is implementing javax.comm and not just a 3rd party extension, might that be the case - that javax.* stuff needs to be in the Java system files? I'm not the Java maven that my coworker is, so I don't know if any of this is gospel or not. Any OS X/Java experts out there willing to comment? We'd like to be able to install RXTX in the safest, most maintenance free way possible, but if there are specific reasons why javax.comm.properties and comm.jar need to be in /System... then so be it. Any information is welcome, Sean From ricardo.trindade at emation.pt Tue Jun 21 15:56:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 22:56:53 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B88D25.7060604@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050621/f6c9f5fe/attachment-0396.html From jeremyah.l.payne at lmco.com Tue Jun 21 15:22:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 16:22:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618955@emss02m08.us.lmco.com> -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Trent Jarvi Sent: Tuesday, June 21, 2005 2:40 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 As of yet we have not decided on the PCI boards to use yet So I am still waiting to se how we will interface to them. But the laptop is ready to use so ill build a test app for that API for now. The overview of class structure is really what I needed. I guess I will use the 2.1 as you suggested. Thanks for the help thus far! BTW, you guys wouldn't happen to keep class diagrams or anything of that nature around would you? If not I will probably end up having to do some anyway for documentation purposes, I could include them. Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From dmarkman at mac.com Tue Jun 21 18:13:28 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 21 Jun 2005 20:13:28 -0400 Subject: [Rxtx] OS X installation - file locations In-Reply-To: References: Message-ID: <044F520C-585C-4B99-82ED-3BA83DB8CE77@mac.com> Apple doesn't recommend to put jars into the /System/Library/Frameworks/JavaVM.framework/Home/lib/ext folder from other hands it's standard java directory to put extentions if you want to support comm api on whole system then I'd recommend to put jars into the /Library/Java/Extensions folder just like you did if you want to support comm api per user put your jars into the ~/ Library/Java/Extensions On Jun 21, 2005, at 5:14 PM, Java RXTX discussion wrote: > Greetings, > > > I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) > using the RXTX installation instructions. RXTX worked fine. > > > Basically you've got: > - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions > - javax.comm.properties in /System/Library/Frameworks/ > JavaVM.framework/Home/lib > - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ > lib/ext > > > My coworker was concerned that the installation required files to be > placed in /System/Library... because those directories are "Apple's" > and subject to change at Apple's whim, and that it would be safer > (less likely to break when a user updates their OS or Java version or > what have you) if all the files could be somewhere in /Library... or / > Library/Java. My coworker points out that when 3rd party apps like > FrontBase and JBoss need to communicate with Java their jars are > placed in /Library/Java/Extensions. Granted that RXTX 2.0 is > implementing javax.comm and not just a 3rd party extension, might > that be the case - that javax.* stuff needs to be in the Java system > files? > > > I'm not the Java maven that my coworker is, so I don't know if any of > this is gospel or not. Any OS X/Java experts out there willing to > comment? We'd like to be able to install RXTX in the safest, most > maintenance free way possible, but if there are specific reasons why > javax.comm.properties and comm.jar need to be in /System... then so > be it. > > > Any information is welcome, > > > Sean > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Dmitry Markman Dmitry Markman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050622/beea65d0/attachment-0396.html From lyon at docjava.com Thu Jun 23 04:39:47 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 23 Jun 2005 06:39:47 -0400 Subject: [Rxtx] web start + RXTX = strange errors? Message-ID: On: Date: Tue, 21 Jun 2005 11:15:53 +0100 From: Jasmine Strong Writes: An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. ----------- I cannot duplicate your error. My version of Java is: java -version java version "1.4.2_05" Is yours the same? Trent: You wrote: passing -source 1.3 -target 1.3 to javac will compile classes without this problem. ----------- OK, I have updated the disto to work with jdk1.3: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Jasmine: Is this working any better? Thanks! - DL From handzisk at tkn.tu-berlin.de Fri Jun 24 02:37:14 2005 From: handzisk at tkn.tu-berlin.de (Vlado Handziski) Date: Fri, 24 Jun 2005 10:37:14 +0200 (CEST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace Message-ID: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Hi all, let me first express my compliments on the great work you have done with the RXTX library. We have been using the library for some time, and we are at a point where we want to make our code public. For legacy reasons, the code that the RXTX library is bundled with, uses the javax.comm namespace. We have been using the ChangePackage script to change the RXTX2.1 package from gnu.io into javax.comm. We need the independent implementation since we want to be able to directly access /dev/ttyUSBx ports in linux and the CommAPI versions are just not as stable. On the download page, there is a comment that this is in violation of sun's license. Can someone shed more light on this. I was not aware that you can protect the names of the java packages. Best regards, Vlado From ricardo.trindade at emation.pt Fri Jun 24 04:01:17 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 11:01:17 +0100 Subject: [Rxtx] parity missed Message-ID: <42BBD9ED.3060004@emation.pt> Hi, I have a "parity missed error". From previous posts I believe this has to do with CMSPAR not being defined. I checked out 2.1 head from CVS. How can I make sure I do a proper build and CMSPAR is defined ? Perhaps it would be good to have a release snapshot that has this, I think the latest snapshot (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. Another question I have, is why must this depend on kernel headers, why can't it be defined in the RXTX source ? thanks Ricardo From jasmine at electronpusher.org Fri Jun 24 04:09:06 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 24 Jun 2005 11:09:06 +0100 Subject: [Rxtx] web start + RXTX = strange errors? In-Reply-To: References: Message-ID: <644aad2bdbba950f0a2fb12d7dcfd8a6@electronpusher.org> On 23 Jun 2005, at 11:39, Dr. Douglas Lyon wrote: > OK, I have updated the disto to work with jdk1.3: > http://show.docjava.com:8086/book/cgij/code/jnlp/ > addbk.JAddressBook.Main.jnlp > > Jasmine: Is this working any better? Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) -J. From taj at www.linux.org.uk Fri Jun 24 10:54:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 17:54:12 +0100 (BST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: On Fri, 24 Jun 2005, Vlado Handziski wrote: > Hi all, > > let me first express my compliments on the great work you have done with > the RXTX library. > > We have been using the library for some time, and we are at a point where > we want to make our code public. For legacy reasons, the code that the > RXTX library is bundled with, uses the javax.comm namespace. We have been > using the ChangePackage script to change the RXTX2.1 package from gnu.io > into javax.comm. We need the independent implementation since we want to > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > versions are just not as stable. > > On the download page, there is a comment that this is in violation of > sun's license. Can someone shed more light on this. I was not aware that > you can protect the names of the java packages. > > Best regards, > Vlado > I can't provide legal advice as I am not a lawyer. (v) may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are contained in the "java", "javax" or "sun" packages or similar as specified by Sun in any class file naming convention; and The license is in the commapi package from Sun. The above is also in all the EULA's you click through to download from Sun if I'm not mistaken. Simply put, the license taints developers that agree to it. For those developers, Sun has control of the javax.comm namespace. It really does not make sense to put rxtx 2.1 in the javax.comm namespace. It will only cause confusion which I think is the point of the clause above. The gnu.io namespace was perhaps a poor choice and just tossed in when reviewing the license to get out of Sun's namespace. There is nothing in the rxtx license limiting your freedom in this fashion though. Many companies are moving to gnu.io and some distribute it with popular applications you would recognize. I'm tempted to ask you not to contaminate rxtx 2.1 with the javax.comm namespace. You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) extensions to existing classes (which I dont think you are using); it is not just javax.comm. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 24 13:24:09 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 20:24:09 +0100 (BST) Subject: [Rxtx] parity missed In-Reply-To: <42BBD9ED.3060004@emation.pt> References: <42BBD9ED.3060004@emation.pt> Message-ID: On Fri, 24 Jun 2005, Ricardo Trindade wrote: > Hi, > > I have a "parity missed error". From previous posts I believe this > has to do with CMSPAR not being defined. > I checked out 2.1 head from CVS. How can I make sure I do a proper > build and CMSPAR is defined ? Perhaps it would be good to have a release > snapshot that has this, I think the latest snapshot > (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. > > Another question I have, is why must this depend on kernel headers, > why can't it be defined in the RXTX source ? > I used to cheat and grab the CMSPAR from the kernel headers because glibc did not have it. Now rxtx uses the glibc headers and we have a patch in glibc I trust that handles this. It would not be right to override glibc and it wasnt right to use the kernel headers (it really did cause problems). You can override glibc for now with the following in the top of SerialImp.c # define CMSPAR 010000000000 You can check if your distro headers have this right bit looking for the above in bits/termios.h. It should look like this: #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif If it is not defined, please file a bug with your distro as rxtx is not the only thing that will be broken on that distro. I was going to release new cvs snapshots last weekend but got tied up. I'll do it this weekend. I also need to get custom baudrate patches into the cvs snapshot. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Fri Jun 24 13:56:50 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 20:56:50 +0100 Subject: [Rxtx] parity missed In-Reply-To: References: <42BBD9ED.3060004@emation.pt> Message-ID: <42BC6582.2070805@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050624/e3b39631/attachment-0396.html From vlado.handziski at gmail.com Sat Jun 25 06:25:52 2005 From: vlado.handziski at gmail.com (Vlado Handziski) Date: Sat, 25 Jun 2005 14:25:52 +0200 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: <697986ec05062505256ebf381f@mail.gmail.com> Thanks for the clarification. Since changing the bundled source is not an option at this moment, we will consider using javax.comm and RXTX2.0. In the next rewrite, we would probably move to gnu.io . Best regards, Vlado Handziski On 6/24/05, Trent Jarvi wrote: > > On Fri, 24 Jun 2005, Vlado Handziski wrote: > > > Hi all, > > > > let me first express my compliments on the great work you have done with > > the RXTX library. > > > > We have been using the library for some time, and we are at a point > where > > we want to make our code public. For legacy reasons, the code that the > > RXTX library is bundled with, uses the javax.comm namespace. We have > been > > using the ChangePackage script to change the RXTX2.1 package from gnu.io > > into javax.comm. We need the independent implementation since we want to > > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > > versions are just not as stable. > > > > On the download page, there is a comment that this is in violation of > > sun's license. Can someone shed more light on this. I was not aware that > > you can protect the names of the java packages. > > > > Best regards, > > Vlado > > > > I can't provide legal advice as I am not a lawyer. > > (v) may not create, or authorize your licensees to create additional > classes, interfaces, or subpackages that are contained in the "java", > "javax" or "sun" packages or similar as specified by Sun in any class file > naming convention; and > > The license is in the commapi package from Sun. The above is also in all > the EULA's you click through to download from Sun if I'm not mistaken. > > Simply put, the license taints developers that agree to it. For those > developers, Sun has control of the javax.comm namespace. > > It really does not make sense to put rxtx 2.1 in the javax.comm namespace. > It will only cause confusion which I think is the point of the clause > above. The gnu.io namespace was perhaps a poor choice and > just tossed in > when reviewing the license to get out of Sun's namespace. > > There is nothing in the rxtx license limiting your freedom in this fashion > though. Many companies are moving to gnu.io and some > distribute it with > popular applications you would recognize. I'm tempted to ask you not > to contaminate rxtx 2.1 with the javax.comm namespace. > > You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm > using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) > extensions to existing classes (which I dont think you are using); it is > not just javax.comm. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050625/1dadc50e/attachment-0396.html From taj at www.linux.org.uk Sun Jun 26 11:34:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 26 Jun 2005 18:34:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. Message-ID: The attached file should fix baud_base and divisor extensions for Linux The patch is against rxtx 2.1 CVS HEAD. To use this patch, you should set the baud rate to 38400. You can then try SerialPort.setBaudBase(int) and SerialPort.setDivisor(int) There are matching int SerialPort.getBaudBase() and int SerialPort.getDivisor(). What baud bases are available depends upon the serial port card and its driver so this is a bit of a blind attempt on my part. I've looked at the w32 API and I dont see anything available yet. The w32 code in RXTX will probably be figuring out the baud rate based on the tried baud base and divisor and just slamming it at the API for now (the API does something with that but I've not found real documentation on what it does). I dont want to try tinkering with the UART directly yet as that would involve poking machine memory directly and could very easily be error prone in bad ways. I don't expect Solaris or any SysV UNIX systems to work at all with this - ever. It is not standard in any way and will throw Exceptions on everything but Linux (w32 will just fail miserably as it is 1/2 implemented). If anyone has looked at custom baud rates before and has some thoughts or just wants to try the attached untested patch, I'd appreciate any feedback. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- ? autom4te.cache ? build ? output cvs server: Diffing . Index: configure =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure,v retrieving revision 1.35.2.59 diff -u -r1.35.2.59 configure --- configure 16 Oct 2004 16:20:34 -0000 1.35.2.59 +++ configure 26 Jun 2005 16:59:28 -0000 @@ -9644,6 +9644,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { #if defined (__GLIBC__) @@ -9782,6 +9784,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { @@ -9825,7 +9829,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -9837,7 +9841,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 26 Jun 2005 16:59:28 -0000 @@ -218,6 +218,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { #if defined (__GLIBC__) @@ -356,6 +358,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { @@ -399,7 +403,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -411,7 +415,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" cvs server: Diffing CNI cvs server: Diffing MACOSX_IDE cvs server: Diffing MACOSX_IDE/CW cvs server: Diffing MACOSX_IDE/ForPackageMaker cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions cvs server: Diffing MACOSX_IDE/ForPackageMaker/Resources cvs server: Diffing MACOSX_IDE/PB cvs server: Diffing WinCE cvs server: Diffing contrib cvs server: Diffing debian cvs server: Diffing src Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 26 Jun 2005 16:59:29 -0000 @@ -2079,15 +2079,17 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int BaudBase The clock frequency divided by 16. Default * BaudBase is 115200. * @return boolean true on success - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:setBaudBase()"); @@ -2097,10 +2099,11 @@ /** * Extension to CommAPI * @return int BaudBase - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getBaudBase() throws UnsupportedCommOperationException + public int getBaudBase() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getBaudBase()"); @@ -2108,13 +2111,14 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, IOException { if ( debug ) z.reportln( "RXTXPort:setDivisor()"); @@ -2124,10 +2128,11 @@ /** * Extension to CommAPI * @returns int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getDivisor() throws UnsupportedCommOperationException + public int getDivisor() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getDivisor()"); Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 26 Jun 2005 16:59:30 -0000 @@ -1877,16 +1877,27 @@ int fd = get_java_var( env, jobj,"fd","I" ); struct serial_struct sstruct; + if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) + { + goto fail; + } + + sstruct.baud_base = (int) BaudBase; + if ( sstruct.baud_base < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetBaudBase", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetBaudBase", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1914,9 +1925,13 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) ( sstruct.baud_base ) ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetBaudBase", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetBaudBase", strerror( errno ) ); @@ -1950,19 +1965,23 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } if ( sstruct.custom_divisor < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetDivisor", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetDivisor", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1971,7 +1990,7 @@ accept: none perform: Find the Divisor used for custom speeds - return: Divisor + return: Divisor negative value on error. exceptions: Unsupported Comm Operation on systems not supporting TIOCGSERIAL comments: @@ -1990,10 +2009,14 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) sstruct.custom_divisor ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetDivisor", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetDivisor", strerror( errno ) ); @@ -2032,7 +2055,7 @@ /* Open and lock the port so nothing else changes the setting */ - if ( LOCK( filename, pid ) ) goto fail;; + if ( LOCK( filename, pid ) ) goto fail; fd = find_preopened_ports( filename ); if( !fd ) Index: src/SerialPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/Attic/SerialPort.java,v retrieving revision 1.3.2.9 diff -u -r1.3.2.9 SerialPort.java --- src/SerialPort.java 12 Oct 2004 08:59:28 -0000 1.3.2.9 +++ src/SerialPort.java 26 Jun 2005 16:59:30 -0000 @@ -103,13 +103,17 @@ public abstract String getUARTType() throws UnsupportedCommOperationException; public abstract boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getBaudBase() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getDivisor() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setLowLatency() throws UnsupportedCommOperationException; public abstract boolean getLowLatency() cvs server: Diffing src/lfd cvs server: Diffing src/psmisc From uwe at kubosch.no Mon Jun 27 14:13:57 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Mon, 27 Jun 2005 22:13:57 +0200 Subject: [Rxtx] RXTX on FC4 Message-ID: <1119903238.2989.27.camel@BPC0276> Hi all! I just got RXTX to work on Fedora Core 4. The standard download did not work. I had to check the code out from CVS and build it, but then it worked flawlessly. Thanks for your good work. Now I wonder if I should contribute the compiled files so that others will have an easier time than me getting RXTX to work on FC4. What do I do? Who do I talk to? donV From taj at www.linux.org.uk Mon Jun 27 14:29:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 27 Jun 2005 21:29:46 +0100 (BST) Subject: [Rxtx] RXTX on FC4 In-Reply-To: <1119903238.2989.27.camel@BPC0276> References: <1119903238.2989.27.camel@BPC0276> Message-ID: On Mon, 27 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I just got RXTX to work on Fedora Core 4. > > The standard download did not work. > > I had to check the code out from CVS and build it, but then it worked > flawlessly. > > Thanks for your good work. > > Now I wonder if I should contribute the compiled files so that others > will have an easier time than me getting RXTX to work on FC4. What do I > do? Who do I talk to? > > The best thing to do with FC is to contibute an extras RPM. Debian does something like this with their .deb packaging. As rxtx is OS neutral, it is almost impossible to have everything on rxtx.org. If you do get a package in Fedora Extras, I can point a link there. The extra's mail list is here: https://www.redhat.com/mailman/listinfo/fedora-extras-list If it would help to have me release a 'stable' .tar.gz of the source for the RPM submittal process I can do that. It would also trigger upgrades in debian which would not be bad. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Mon Jun 27 16:23:20 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 27 Jun 2005 17:23:20 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: Message-ID: <42C07C58.1030608@atcorp.com> Hey Trent, I installed it and now I get IOExceptions instead of the other one. I'm not sure how those changes would have enabled setDivisor and setBaudBase to work though. Is it significant that this is a USB device emulating a serial port? ~ Shawn From taj at www.linux.org.uk Mon Jun 27 18:07:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 01:07:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: <42C07C58.1030608@atcorp.com> References: <42C07C58.1030608@atcorp.com> Message-ID: On Mon, 27 Jun 2005, Shawn Lavelle wrote: > Hey Trent, > I installed it and now I get IOExceptions instead of the other one. > I'm not sure how those changes would have enabled setDivisor and > setBaudBase to work though. Is it significant that this is a USB device > emulating a serial port? > The USB driver probably does not support this. With USB, the ioctl()'s appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through the linux drivers/usb tree and found to ioctl to support this in Linux 2.6.10. RXTX is not doing very much magic, the patch really only gets the serial struct instead of writing a structure with random values for baudbase and handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel level driver issue not a user space library issue. So if you wanted this to work, the usb serial driver would have to handle the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression after looking through the USB tree quickly. I hope that helps. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Jun 27 18:25:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 27 Jun 2005 20:25:22 -0400 Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) Message-ID: Hi All, I wrote: Jasmine: Is this working any better? And Jasmine says: Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) I am using -source 1.3 and -target 1.3 for the compilation, however, we still seem to have this problem, which my machine (for some reason) does not have. Does anyone have any ideas about what might be the problem? Thanks! - DL From taj at www.linux.org.uk Mon Jun 27 19:04:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 02:04:37 +0100 (BST) Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) In-Reply-To: References: Message-ID: On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I wrote: > Jasmine: Is this working any better? > > And Jasmine says: > Nope. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > > I am using -source 1.3 and -target 1.3 > for the compilation, however, we still seem to have this problem, > which my machine (for some reason) does not have. > Does anyone have any ideas about what might be the problem? > This has shown up in the past with jdk 1.5 compiled jars running on jre 1.4 machines. My guess is either jasmine has an old copy of rxtx with the problem on her machine that is being picked up on the classpath or you have not tried this with jre 1.4. The suggested -source/target fix should avoid the problem. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Mon Jun 27 21:23:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 04:23:55 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: On Tue, 28 Jun 2005, Trent Jarvi wrote: > On Mon, 27 Jun 2005, Shawn Lavelle wrote: > > > Hey Trent, > > I installed it and now I get IOExceptions instead of the other one. > > I'm not sure how those changes would have enabled setDivisor and > > setBaudBase to work though. Is it significant that this is a USB device > > emulating a serial port? > > > > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > > RXTX is not doing very much magic, the patch really only gets the serial > struct instead of writing a structure with random values for baudbase and > handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel > level driver issue not a user space library issue. > > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. > > I hope that helps. > > > It may be possible that you can just modify translate_speed and get_java_baudrate in SerialImp.c to have the new high speds you are after. The defines are in /usr/include/termios.h. #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 You can see many of these are not handled. I dont think CommAPI handled more than 57600 or so. int get_java_baudrate( int native_speed ) { switch( native_speed ) { case B0: return 0; case B50: return 50; case B75: return 75; case B110: return 110; case B134: return 134; case B150: return 150; case B200: return 200; case B300: return 300; case B600: return 600; case B1200: return 1200; case B1800: return 1800; case B2400: return 2400; case B4800: return 4800; case B9600: return 9600; case B19200: return 19200; case B38400: return 38400; case B57600: return 57600; default: return -1; } } int translate_speed( JNIEnv *env, jint speed ) { LEAVE( "RXTXPort:translate_speed" ); switch( speed ) { case 0: return B0; case 50: return B50; case 75: return B75; case 110: return B110; case 134: return B134; case 150: return B150; case 200: return B200; case 300: return B300; case 600: return B600; case 1200: return B1200; case 1800: return B1800; case 2400: return B2400; case 4800: return B4800; case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; #ifdef B57600 case 57600: return B57600; #endif /* B57600 */ #ifdef B115200 case 115200: return B115200; #endif /* B115200 */ #ifdef B230400 case 230400: return B230400; #endif /* B230400 */ #ifdef B460800 case 460800: return B460800; #endif /* B460800 */ #ifdef B14400 case 14400: return B14400; #endif /* B14400 */ #ifdef B28800 case 28800: return B28800; #endif /* B28800 */ #ifdef B128000 /* dima */ case 128000: return B128000; #endif /* dima */ #ifdef B256000 /* dima */ case 256000: return B256000; #endif /* dima */ } /* Handle custom speeds */ if( speed >= 0 ) return speed; else { LEAVE( "RXTXPort:translate_speed: Error condition" ); return -1; } } -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 28 05:20:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 28 Jun 2005 07:20:21 -0400 Subject: [Rxtx] cross-compilation using Make for Mac Message-ID: Hi All, Please excuse the long post; Trent said: >" >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. " Here is what I have on the mac version: java -version java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) When I run: http://show.docjava.com:8086/book/cgij/code/jnlp/math.benchmarks.Dhry.jnlp I get: -- listing properties -- jnlpx.heapsize=NULL,NULL jnlpx.splashport=-1 java.runtime.name=Java(TM) 2 Runtime Environment, Stand... java.protocol.handler.pkgs=com.sun.javaws.net.protocol sun.boot.library.path=/System/Library/Frameworks/JavaVM.fra... java.vm.version=1.4.2-38 awt.nativeDoubleBuffering=true gopherProxySet=false http.auth.serializeRequests=true java.vm.vendor="Apple Computer, Inc." java.vendor.url=http://apple.com/ path.separator=: java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io jnlpx.home=/Applications/Utilities/Java/Java Web... user.country=US sun.os.patch.level=unknown java.vm.specification.name=Java Virtual Machine Specification user.dir=/ java.runtime.version=1.4.2_05-141.4 java.awt.graphicsenv=apple.awt.CGraphicsEnvironment java.endorsed.dirs=/System/Library/Frameworks/JavaVM.fra... os.arch=ppc java.io.tmpdir=/tmp line.separator= java.vm.specification.vendor=Sun Microsystems Inc. jnlpx.remove=false os.name=Mac OS X sun.java2d.fontpath= java.library.path=/Applications/Utilities/Java/Java Web... java.specification.name=Java Platform API Specification java.class.version=48.0 jnlpx.deployment.user.home=/Users/lyon/Library/Caches/Java Web S... java.util.prefs.PreferencesFactory=java.util.prefs.MacOSXPreferencesFactory os.version=10.3.9 user.home=/Users/lyon user.timezone=America/New_York java.security.policy=file:/Applications/Utilities/Java/Jav... java.awt.printerjob=apple.awt.CPrinterJob trustProxy=true java.specification.version=1.4 file.encoding=MacRoman jnlpx.deployment.system.home=/Applications/Utilities/Java/J2SE 5.0... user.name=lyon java.class.path=/Applications/Utilities/Java/Java Web... java.vm.specification.version=1.0 sun.arch.data.model=32 java.home=/System/Library/Frameworks/JavaVM.fra... java.specification.vendor=Sun Microsystems Inc. user.language=en awt.toolkit=apple.awt.CToolkit java.vm.info=mixed mode java.version=1.4.2_05 java.ext.dirs=/Users/lyon/Library/Java/Extensions:/... sun.boot.class.path=/System/Library/Frameworks/JavaVM.fra... java.vendor=Apple Computer, Inc. file.separator=/ java.vendor.url.bug=http://developer.apple.com/java/ sun.cpu.endian=big sun.io.unicode.encoding=UnicodeBig mrj.version=141.3 jnlpx.jvm=/System/Library/Frameworks/JavaVM.fra... sun.cpu.isalist= sun.awt.exception.handler=apple.awt.CToolkit$EventQueueExceptio... javawebstart.version=javaws-1.4.2_05 800 mhz g4,878k ds/sec total time: 1184ms Result: 844594 dhrystone/sec. Load average for last 15 minutes:0.62 So, I feel pretty sure that I have tried this with 1.4. As to modifying the RXTX compilation, that I did not do...and I take your point. I have been using the binary distributions as is. Oops. I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Now when I do a make, I get: make gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known libtool: link: warning: undefined symbols not allowed in i386-pc-mingw32 shared libraries rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ln: `SerialImp.o': File exists make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 So, I do a make clean, then a make: .... (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ar cru .libs/librxtxSerial.a /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o ar: /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o: No such file or directory make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 In the i386 directory, there is a symbolic link left from something: ls -al SerialImp.o lrwxrwxrwx 1 lyon lyon 12 Jun 28 07:03 SerialImp.o -> SerialImp.lo However, the SerialImp.lo is not present (which is the cause of the error, I think). On the other hand, the file I am looking for is present in: i686-pc-linux-gnu Possibly the i386 generation is not clean (of course it is also likely that I am just asking dumb questions, being a newbie to the code and all.). Finally, will this make file regenerate the distro for the mac? I found some really old (from year 2001) files in: cvs/MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions Which I could use for the distro...but I would prefer to do a clean, multi-platform build from make. Thanks! - Doug >On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > >> Hi All, >> I wrote: >> Jasmine: Is this working any better? >> >> And Jasmine says: >> Nope. >> >> An error occurred while launching/running the application. >> >> Title: addbk.JAddressBook.Main >> Vendor: DocJava, Inc. >> Category: Unexpected Error >> >> gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) >> >> > > I am using -source 1.3 and -target 1.3 >> for the compilation, however, we still seem to have this problem, >> which my machine (for some reason) does not have. >> Does anyone have any ideas about what might be the problem? >> > >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. > > >The suggested -source/target fix should avoid the problem. > >-- >Trent Jarvi >tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 28 09:43:41 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 28 Jun 2005 10:43:41 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: <42C1702D.1070307@atcorp.com> > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. There is ioctl stuff in the driver for the chip, but i haven't seen the TIOC*SERIAL entries. That might be why it continues to fail. I did get around the problem, though, by hacking the driver and just specifying the baud rate I need. Now everything works well. Thanks for all the assistance you've provided. ~ Shawn M. Lavelle From taj at www.linux.org.uk Tue Jun 28 12:42:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:42:29 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known Add a compiler flag -DWIN32 The code above should not be compiling on w32 as it is #if !defined(WIN32) You can look at the bottom of Makefile.in to see the w32 compile flags. Search for "WIN32 CrossCompiling from here down" If its still not working, I can set you up with the Bob account. Just email me off the list. W32 compiling is a bit complicated. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 28 12:52:50 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:52:50 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Nods. I did change configure but right now it is only in the baudbase/divisor patch I posted. I'm going to add several extension baud rates that can be supported by normal API calls and commit that today as a followup to my comments yesterday on baudrates. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Wed Jun 29 01:52:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 08:52:10 +0100 (BST) Subject: [Rxtx] [PATCH] More baud rate fixes Message-ID: I went through the native baudrate conversion from Java and added several. This patch is against CVS 2.1 head. I think thats it for baud rate fixes unless someone see something. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- A non-text attachment was scrubbed... Name: baud_base_and_divisor_plus_odd_baudrates.diff.gz Type: application/x-gzip Size: 3291 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050629/4c1ef1c2/baud_base_and_divisor_plus_odd_baudrates.diff-0396.gz From lyon at docjava.com Wed Jun 29 10:33:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 29 Jun 2005 12:33:45 -0400 Subject: [Rxtx] java.comm dependencies Message-ID: Hi All, During a build of the rxtx code, I have left the javax.comm out of the system (on purpose). However, I get an error, at run time: CommPortIdentifier:static initialization() apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: javax/comm/CommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver I am thinking that there is something in the gnu.io.CommPortIdentifier that seeks to load the javax.comm.CommDriver. It was my understanding that we could write code without reference to the javax.comm.CommDriver and that we could work in the gnu namespace. Is this true? Thanks! - Doug From taj at www.linux.org.uk Wed Jun 29 11:16:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 18:16:08 +0100 (BST) Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > During a build of the rxtx code, I have left the > javax.comm out of the system (on purpose). > However, I get an error, at run time: > > CommPortIdentifier:static initialization() > apple.awt.EventQueueExceptionHandler Caught Throwable : > java.lang.NoClassDefFoundError: javax/comm/CommDriver > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > that seeks to load the javax.comm.CommDriver. > > It was my understanding that we could write code without reference > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > Is this true? > Yes. People use 2.1 without javax all the time. There should be no reference to javax at all in rxtx 2.1. You may check your code. I just did a grep through 2.1 and there is nothing. You may look at the classes you are using. If you find javax.comm in your code, replace it with gnu.io and that should be all you need to do. -- Trent Jarvi tjarvi at qbang.org From jayant28k at gmail.com Wed Jun 29 21:49:28 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Thu, 30 Jun 2005 09:19:28 +0530 Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: <6a6a02310506292049778c452f@mail.gmail.com> Trent, I think best idea is to have wiki for rxtx code. So as the traffic is increasing with time. "RXTX" seems to be more popular in embbeded system. Sun Microsystems will always apperciate your efforts on parallel and serial ports commincation based application in IT Industry. Thanks for your help on this forum as "ONE MAN ARMY" ;-) Cheers, Jayant On 6/29/05, Trent Jarvi wrote: > On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > > > Hi All, > > During a build of the rxtx code, I have left the > > javax.comm out of the system (on purpose). > > However, I get an error, at run time: > > > > CommPortIdentifier:static initialization() > > apple.awt.EventQueueExceptionHandler Caught Throwable : > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > > that seeks to load the javax.comm.CommDriver. > > > > It was my understanding that we could write code without reference > > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > > > Is this true? > > > > Yes. People use 2.1 without javax all the time. > > There should be no reference to javax at all in rxtx 2.1. You may check > your code. I just did a grep through 2.1 and there is nothing. You may > look at the classes you are using. > > If you find javax.comm in your code, replace it with gnu.io and that > should be all you need to do. > > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From uwe at kubosch.no Sat Jun 25 02:50:24 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Sat, 25 Jun 2005 10:50:24 +0200 Subject: [Rxtx] RXTX in FC3/FC4 Message-ID: <1119689424.12606.14.camel@BPC0276> Hi all! I am trying to get RXTX to work on Fedora Core, version 3 or 4. I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext directory. I have edited the jre/lib/javax.comm.properties according to the docs. I have tried this with both rxtx 2.0 and 2.1. I have tried on two different machines. I have tried with java 1.4.2 and java 1.5.0, both from Sun. I always get a signall 11 from the native libraries when they are loaded. Is this a common problem? Any help is greatly appreciated. Below is the start of the error message. More can be supplied on demand. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x65015A Function=(null)+0x65015A Library=/lib/ld-linux.so.2 NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) - locked <0xed46f628> (a java.util.Vector) - locked <0xed471708> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xed46ebc0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.InitializeDriver(CommPortIdentifier.java:213) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:248) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:351) at com.jpeterson.x10.module.CM11A.allocate(CM11A.java:1160) at net.sourceforge.cruisecontrol.publishers.X10Publisher.send(X10Publisher.java:182) at net.sourceforge.cruisecontrol.publishers.X10Publisher.turnOff(X10Publisher.java:171) at net.sourceforge.cruisecontrol.publishers.X10Publisher.handleBuild(X10Publisher.java:148) at net.sourceforge.cruisecontrol.publishers.X10Publisher.publish(X10Publisher.java:141) at net.sourceforge.cruisecontrol.Project.publish(Project.java:679) at net.sourceforge.cruisecontrol.Project.build(Project.java:227) at net.sourceforge.cruisecontrol.Project.execute(Project.java:153) at net.sourceforge.cruisecontrol.ProjectWrapper.run(ProjectWrapper.java:66) at java.lang.Thread.run(Thread.java:534) From chris_jh at blueyonder.co.uk Tue Jun 28 05:37:10 2005 From: chris_jh at blueyonder.co.uk (Christopher Harris) Date: Tue, 28 Jun 2005 12:37:10 +0100 Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError Message-ID: <42C13666.9030108@blueyonder.co.uk> Hi I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 32bit) The serial ports work fine with no issues, but when i try to use the parallel port i get this message Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:66) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) I am trying to print a line out to port "/dev/lp0" At first i thought it could not find the librxtxParallel.so file, but when i renamed it i got a different saying it could not find the library. I have tried to run as root no difference. It is really weird, i get no compile errors and the serial ports work fine. I changed the LPRPort.java and commented out the Initialize call method. And just get the same error but for the method open. It is as though it can't see the methods, and yet it can see the library. I did have a bit of check of the JNI implementation in rxtx but could not spot anything. Yours Thankfully Christopher Harris From lyon at docjava.com Thu Jun 30 02:28:09 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 04:28:09 -0400 Subject: [Rxtx] tools Message-ID: Hi All, I have been thinking about automatic cross-platform native method development of Java/C programs. It appears that different binary tools are needed to target different platforms. Configuration seems a bit painful. Is there something better available than make? Is ANT any good at this? Has anyone tried: http://jnipp.sourceforge.net/ Thanks! - Doug From lyon at docjava.com Thu Jun 30 04:11:17 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 06:11:17 -0400 Subject: [Rxtx] javax.comm Message-ID: Hi All, When I load my jar files on a linux box, all is well. However, when I load them on a mac, I get: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver The jar files for the mac are different from the jar files for linux, because recompilation of the native code for the mac has not been easy, for me. As a result, the RXTX jars are tending toward specific versions and platforms. Probably, this is not an ideal situation, but, I suspect, it is common. I have an idea that we could create a single JNLP distro site that we can make reference to that would enable a uniform repository of synchronized signed native methods and jars for RXTX. For example, the one-wire Maxim folks have a real-nice approach where their stuff makes reference to another JNLP file that contains all the stuff we need to make RXTX work. Check it out at: http://www.maxim-ic.com/products/ibutton/software/1wire/OneWireViewer.cfm However, even they have problems on an unconfigured machine: Specified adapter name "DS9097U" is not known * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cannot load default adapter. Please check that the adapter is connected and that no other application is using the port. If you have checked the adapter, the default port might not be selected. Either set the value of the TMEX default using the utility provided with the TMEX Runtime, or create a new file in the /lib folder called onewireviewer.properties with two lines, similar to the following: #native win32 drivers adapter.name={DS9097U} adapter.port=COM1 #or javax.comm drivers adapter.name=DS9097U adapter.port=COM1 The full path to this file should be: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/onewireviewer.properties ---- Wow, that is a show stopper! Configuration is something that we really need to think about as an automatic thing, particularly for web start users. You can't ask a person who wants to run an application to figure out how to alter a properties file. If you know you need one, then get permission and make one...automatically. That makes a lot of sense, to me. Basically, we need an installer. At the very least, all the pre-built binaries and jars needed for the RXTX package on several platforms should be available from a single place. One this happens, we can make a JNLP file that is platform specific, but can give us a level of indirection. Is this something that has been done already? Thanks! - Doug From taj at www.linux.org.uk Thu Jun 30 08:10:22 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 15:10:22 +0100 (BST) Subject: [Rxtx] tools In-Reply-To: References: Message-ID: On Thu, 30 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I have been thinking about automatic cross-platform > native method development of Java/C programs. > > It appears that different binary tools are needed to target different > platforms. Configuration seems a bit painful. > > Is there something better available than make? > > Is ANT any good at this? I'm far from an Ant expert but have used it for other projects. The main problem I see with ant is there is no mainstream support for platform neutral neutral library creation as far as I can tell. I think ant is a fine replacement for make but I've not seen a suitable replacement for autoconf. At that point, make is as good as anything. It should be possible to create a ant build.xml that works on say Solaris, Linux, Windows and Mac OS X. The problem is when you are trying to build a library for embeded ARM from Mac OS X. > Has anyone tried: > http://jnipp.sourceforge.net/ -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:22:02 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:22:02 +0100 (BST) Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <1119689424.12606.14.camel@BPC0276> References: <1119689424.12606.14.camel@BPC0276> Message-ID: On Sat, 25 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I am trying to get RXTX to work on Fedora Core, version 3 or 4. > > I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 > directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext > directory. > > I have edited the jre/lib/javax.comm.properties according to the docs. > > I have tried this with both rxtx 2.0 and 2.1. > > I have tried on two different machines. > > I have tried with java 1.4.2 and java 1.5.0, both from Sun. > > I always get a signall 11 from the native libraries when they are > loaded. Is this a common problem? Any help is greatly appreciated. > Below is the start of the error message. More can be supplied on > demand. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x65015A > Function=(null)+0x65015A > Library=/lib/ld-linux.so.2 > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) If you compile rxtx from source, this will probably go away. I'm not sure what the exact cause is but it looks like the binaries are not suitable for FC3/4. The ABI may have changed since those had been compiled. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:26:56 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:26:56 +0100 (BST) Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError In-Reply-To: <42C13666.9030108@blueyonder.co.uk> References: <42C13666.9030108@blueyonder.co.uk> Message-ID: tOn Tue, 28 Jun 2005, Christopher Harris wrote: > Hi > > I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 > 32bit) > > The serial ports work fine with no issues, but when i try to use the > parallel port i get this message > > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:66) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) > > > I am trying to print a line out to port "/dev/lp0" > > At first i thought it could not find the librxtxParallel.so file, but > when i renamed it i got a different saying it could not find the library. > > I have tried to run as root no difference. > > It is really weird, i get no compile errors and the serial ports work fine. > > I changed the LPRPort.java and commented out the Initialize call method. > And just get the same error but for the method open. > > It is as though it can't see the methods, and yet it can see the library. > I did have a bit of check of the JNI implementation in rxtx but could > not spot anything. > > > You can check if the symbols are in the shared library: nm librxtxSerial.so |grep Initialize If the symbols are not there, there was a build error. Watch very close for build errors while compiling from source. I suspect something isnt behaving right. -- Trent Jarvi tjarvi at qbang.org From allen at adbyrne.us Thu Jun 30 06:55:58 2005 From: allen at adbyrne.us (Allen Byrne) Date: Thu, 30 Jun 2005 07:55:58 -0500 Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> References: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> Message-ID: <200506300755.59159.allen@adbyrne.us> On Thursday 30 June 2005 00:31, rxtx-request at mail.electronpusher.org wrote: > >Message: 8 >Date: Sat, 25 Jun 2005 10:50:24 +0200 >From: Uwe Kubosch >Subject: [Rxtx] RXTX in FC3/FC4 >To: rxtx at mail.electronpusher.org >Message-ID: <1119689424.12606.14.camel at BPC0276> >Content-Type: text/plain > >Hi all! > >I am trying to get RXTX to work on Fedora Core, version 3 or 4. > >I have tried this with both rxtx 2.0 and 2.1. > >I have tried on two different machines. > >I have tried with java 1.4.2 and java 1.5.0, both from Sun. > >I always get a signall 11 from the native libraries when they are >loaded. ?Is this a common problem? ?Any help is greatly appreciated. >Below is the start of the error message. ?More can be supplied on >demand. > >An unexpected exception has been detected in native code outside the VM. >Unexpected Signal : 11 occurred at PC=0x65015A >Function=(null)+0x65015A >Library=/lib/ld-linux.so.2 > I had thi same problem on SUSE9.3 and java 1.5.0. After searching through the archives, I found a patch that required adding a sleep(1000) command in two functions of SerialIO.java. This only was for rxtx2.1, I had no trouble with rxtx2.0. Note, also I had to add the "|1.5*" sequence to the configure.in file to get good *.so libs. Again 2.0 was fine. -- Allen Byrne adbyrne at ieee.org http://modelrr.adbyrne.us From taj at www.linux.org.uk Fri Jun 3 01:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 08:57:29 +0100 (BST) Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 3 09:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 16:57:53 +0100 (BST) Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi at qbang.org From jasmine at electronpusher.org Fri Jun 3 10:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 17:12:21 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 11:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:02:09 +0100 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 11:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:05:10 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From jon.nall at gmail.com Mon Jun 6 09:13:58 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 10:13:58 -0500 Subject: [Rxtx] StackOverflowError Message-ID: I have a fairly small application that is communicating to a microcontroller programmer at 115.2k. I have a test where I try and dump the memory of the microcontroller (whose size is 8k and change). Things are going smoothly and the data looks good. Then after reading out ~6.5k of data, I get a StackOverflowError. The stack trace looks like: CommInterface.serialEvent(): 324 // this is my code RXTXPort.sendEvent(): 732 RXTXPort.eventLoop() [Native] MonitorThread.run(): 1531 I am running on windows and using rxtx-2.1-CVS-20050120. When I increased the stack size to 512k, I could read the entire chip without issue. But that doesn't seem like the right thing to do without root causing what's happening. My code doesn't include any recursion and the stack trace looks terribly short, so I'm a bit confused as to why I'm getting a StackOverflowError. CommInterface.serialEvent() does little more than grab the available bytes, enter a synchronized block, stick them in a common data area for the main thread to use and leave the synchronization block. I guess my question is: are there any known issues with the default stack size when using the latest rxtx on windows? thanks, nall. From taj at www.linux.org.uk Mon Jun 6 09:27:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 16:27:34 +0100 (BST) Subject: [Rxtx] StackOverflowError In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > I have a fairly small application that is communicating to a > microcontroller programmer at 115.2k. I have a test where I try and > dump the memory of the microcontroller (whose size is 8k and change). > Things are going smoothly and the data looks good. Then after reading > out ~6.5k of data, I get a StackOverflowError. The stack trace looks > like: > > CommInterface.serialEvent(): 324 // this is my code > RXTXPort.sendEvent(): 732 > RXTXPort.eventLoop() [Native] > MonitorThread.run(): 1531 > > I am running on windows and using rxtx-2.1-CVS-20050120. When I > increased the stack size to 512k, I could read the entire chip without > issue. But that doesn't seem like the right thing to do without root > causing what's happening. My code doesn't include any recursion and > the stack trace looks terribly short, so I'm a bit confused as to why > I'm getting a StackOverflowError. > > CommInterface.serialEvent() does little more than grab the available > bytes, enter a synchronized block, stick them in a common data area > for the main thread to use and leave the synchronization block. > > I guess my question is: are there any known issues with the default > stack size when using the latest rxtx on windows? > This is the first I've heard of the problem. It is strange as you mention lookin at the stack trace. That cant be taking up too much space. If you just toss the data instead of trying to put it in your work area, does it persist? -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Mon Jun 6 10:09:39 2005 From: lengyel at gmail.com (FL) Date: Mon, 6 Jun 2005 12:09:39 -0400 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on which the jdk1.5.0_03 is installed. I found that the INSTALL documentation seems to be in error. It states that javacomm20-x86.tar.Z (the Java Communications API for Solaris/x86) must be used, in fact this choice led to the following test with theBlackBox sample program in the commapi: root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG BlackBox -p /dev/ttyS0 Port /dev/ttyS0 not found! No serial ports found! Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to cause Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to the Eclipse stable build version 3.1M7 to avoid this. However, I found that using the Solaris/Sparc version of commapi worked on my system. I have documented this on: http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050606/b28fb9a7/attachment-0397.html From taj at www.linux.org.uk Mon Jun 6 10:30:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:30:27 +0100 (BST) Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, FL wrote: > I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on > which the jdk1.5.0_03 is installed. I found that the INSTALL documentation > seems to be in error. It states that javacomm20-x86.tar.Z (the Java > Communications API for Solaris/x86) must be used, in fact this choice led to > the following test with theBlackBox sample program in the commapi: > > root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG > BlackBox -p /dev/ttyS0 > Port /dev/ttyS0 not found! > No serial ports found! > > Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to > cause > Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to > the Eclipse stable build version 3.1M7 to avoid this. > > However, I found that using the Solaris/Sparc version of commapi > worked on my system. > > I have documented this on: > > http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 > Thanks FL. I'll change the documentation to point to the SPARC comm.jar. In the past, any Solaris was good enough, we tried to avoid the w32 comm.jar because it made native calls rxtx would never implement on any OS as they are not platform neutral. I'll withold comments about Sun's comm.jar being different on various CPUs within even the same OS. RXTX 2.1 does not need to do that even acrossed OSs for instance. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 6 10:35:43 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 11:35:43 -0500 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API Message-ID: It seems that Sun's javax.comm site does not include JavaDoc'ed API and the RxTx site has the API, but no real documentation. Is there some site that i'm just missing in my google searches? I'm looking for a copy of the javax.comm API which is documented. Thanks, nall. From taj at www.linux.org.uk Mon Jun 6 10:44:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:44:03 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > It seems that Sun's javax.comm site does not include JavaDoc'ed API > and the RxTx site has the API, but no real documentation. Is there > some site that i'm just missing in my google searches? I'm looking for > a copy of the javax.comm API which is documented. > > Thanks, > nall. Sun's version is with their binary downloads. RXTX tries to match that so I never bothered with more complete JavaDocs. Whatever Sun documents is what we try to do. -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Mon Jun 6 12:13:44 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 6 Jun 2005 14:13:44 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: Message-ID: <20050606181245.528C929D56F@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Trent Jarvi > Sent: Monday, June 06, 2005 12:44 PM > To: Jon Nall; Java RXTX discussion > Subject: Re: [Rxtx] Where can I find JavaDoc on the javax.comm API > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > It seems that Sun's javax.comm site does not include JavaDoc'ed API > > and the RxTx site has the API, but no real documentation. Is there > > some site that i'm just missing in my google searches? I'm > looking for > > a copy of the javax.comm API which is documented. > > > > Thanks, > > nall. > > Sun's version is with their binary downloads. RXTX tries to > match that so I never bothered with more complete JavaDocs. > Whatever Sun documents is what we try to do. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Try http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht ml -Ack From gadelavega at yahoo.com.ar Mon Jun 6 12:58:09 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Mon, 6 Jun 2005 15:58:09 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606181245.528C929D56F@mail.electronpusher.org> Message-ID: <20050606185809.57069.qmail@web14603.mail.yahoo.com> --- "David S. Acker" escribi?: > > -----Original Message----- > > From: rxtx-bounces at mail.electronpusher.org > > [mailto:rxtx-bounces at mail.electronpusher.org] On > Behalf Of Trent Jarvi > > Sent: Monday, June 06, 2005 12:44 PM > > To: Jon Nall; Java RXTX discussion > > Subject: Re: [Rxtx] Where can I find JavaDoc on > the javax.comm API > > > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > > > It seems that Sun's javax.comm site does not > include JavaDoc'ed API > > > and the RxTx site has the API, but no real > documentation. Is there > > > some site that i'm just missing in my google > searches? I'm > > looking for > > > a copy of the javax.comm API which is > documented. > > > > > > Thanks, > > > nall. > > > > Sun's version is with their binary downloads. > RXTX tries to > > match that so I never bothered with more complete > JavaDocs. > > Whatever Sun documents is what we try to do. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > Try > http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > ml > -Ack > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > I'm prety sure it was there... but not anymore. Gonzalo A. de la Vega, BI ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From taj at www.linux.org.uk Mon Jun 6 18:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 01:09:14 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606185809.57069.qmail@web14603.mail.yahoo.com> References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: >> http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > > I'm prety sure it was there... but not anymore. > It is there. Maybe the URL got mangled. Try this http://tinyurl.com/8dfp7 It just redirects you to: http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.html -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 7 05:46:39 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Jun 2005 07:46:39 -0400 Subject: [Rxtx] rxtx under fedora - odd procedures Message-ID: Hi All, I was able to get RXTX communications to work under Fedora, but only after I added myself to the UUCP and LOCK groups, logged out and then logged back in. Both groups appear to be needed in order to access the serial ports. Also the group alter did not take until after I logged out and logged back in. My theory is that you need permission to write to the var/spool directory under fedora and that this is the only way to do it. Logging out and logging back in just seems like an odd thing to do. I suppose some users may have to restart X. Ouch! Is this true? The alter_group command indicates that you need to be an su to alter the group database. Does this mean that my serial port users need a database su able person to use serial port applications under RXTX? If so, what is the procedure to make a transparent install work using Java web start? Should I be prompting users for the su password? Should I be telling users to exit from X and log out? Is this the way other serial communications programs work? Thanks! - Doug From sean_montgomery at baseview.com Tue Jun 7 08:14:51 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 7 Jun 2005 10:14:51 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: >>> http://java.sun.com/products/javacomm/javadocs/javax/comm/package- >>> summary.ht >>> > > >> >> I'm prety sure it was there... but not anymore. >> >> > > It is there. Maybe the URL got mangled. Try this > > http://tinyurl.com/8dfp7 > > It just redirects you to: > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > summary.html > Maybe the issue here is that the info is available without frames from that URL, but when you try to access it with frames (from the link on that page) it doesn't work - it takes you to: http://java.sun.com/products/javacomm/javadocs/index.html Which doesn't have anything useful on it. From gadelavega at yahoo.com.ar Tue Jun 7 08:22:50 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:22:50 -0300 (ART) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: Message-ID: <20050607142251.92850.qmail@web14626.mail.yahoo.com> --- "Dr. Douglas Lyon" escribi?: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the > group > alter did not take until after I logged out and > logged back in. > > My theory is that you need permission to write to > the var/spool > directory under fedora and that this is the only way > to do it. > > Logging out and logging back in just seems like an > odd thing to > do. I suppose some users may have to restart X. > Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port > applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log > out? > Is this the way other serial communications programs > work? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Actually, you need the lock group to acces /var/lock directory, and uucp to acces /dev/ttyS*. You (as root) shuold add all users you will allow to use the serial ports to group uucp and all the ones you'll allow to lock the ports to lock group (rxtx needs both). This is not only for rxtx, but for any use of the serial ports. Next time they login they'll be able to work, so if they are in they'll have to log out first. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From gadelavega at yahoo.com.ar Tue Jun 7 08:23:56 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:23:56 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> Message-ID: <20050607142356.93815.qmail@web14624.mail.yahoo.com> --- Sean Montgomery escribi?: > > On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: > > >>> > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > >>> summary.ht > >>> > > > > > >> > >> I'm prety sure it was there... but not anymore. > >> > >> > > > > It is there. Maybe the URL got mangled. Try this > > > > http://tinyurl.com/8dfp7 > > > > It just redirects you to: > > > > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > > summary.html > > > > Maybe the issue here is that the info is available > without frames > from that URL, but when you try to access it with > frames (from the > link on that page) it doesn't work - it takes you > to: > > http://java.sun.com/products/javacomm/javadocs/index.html > > Which doesn't have anything useful on it. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > That's right, my bad. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From jon.nall at gmail.com Tue Jun 7 08:33:40 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 09:33:40 -0500 Subject: [Rxtx] performance expectations Message-ID: Hi all. I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC microcontroller. The protocol I'm using (which I didn't create) looks like this for the section of code I'm concerned with: PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data PIC -> PC: 0x01 // ACK 0xNN // First 8 bits of data 0xMM // Second 8 bits of data I issue ~2000 of these Read commands. The PIC itself has an input fifo which can store 18 bytes, so I can have 18 read commands in flight at a given time. The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k 8N1. I am measuring the time it takes to perform these 2000 commands at around 30 seconds, which is much longer than I anticipated. With the link fully utilized, I expected: Time per byte transmitted: 115200 / 8 = 14400 bytes/second = ~70 uS/byte Time per response transmitted: ~70 uS/byte * 3 bytes/response = ~210 uS/response Time for 2000 responses to be transmitted: ~210 uS/response * 2000 responses = ~420ms I'm a bit new to this, so I may have made some bad asumptions, but I would have expected a time of a couple of seconds to perform the 2000 reads, not 30+ seconds. I'm obviously missing something here. Can someone help me understand what's going on? Thanks, nall. From taj at www.linux.org.uk Tue Jun 7 09:17:48 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:17:48 +0100 (BST) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the group > alter did not take until after I logged out and logged back in. > > My theory is that you need permission to write to the var/spool > directory under fedora and that this is the only way to do it. > > Logging out and logging back in just seems like an odd thing to > do. I suppose some users may have to restart X. Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log out? > Is this the way other serial communications programs work? > RIght now, rxtx requires you do one of two things. 1) Use lock files (recommended). This requires intervention by the root users to allow users to create lock files and open the ports as you note. 2) configure rxtx with --disable-lockfiles. In this case you need only worry about the permissions on /dev/ttyS* I'm not sure what the default on Fedora is with respect to permisions. This is not very attractive. There is a better way it could be done on Fedora. Fedora comes with lockdev library. I've been considering this for some time. We could use that for the locking and do away with many of the problems. The problem is embeded devices running Linux do not come with liblockdev. But for your use, I would consider adding a new option for locking serial devices using liblockdev. lockdev-devel has a man page with further information. SYNOPSIS #include pid_t dev_testlock( const char * devname); pid_t dev_lock( const char * devname); pid_t dev_relock( const char * devname, pid_t pid); pid_t dev_unlock( const char * devname, pid_t pid); cc [ flag ... ] file ... -llockdev [ library ] This would probably need to be a configure time option to prevent problems on embeded Linux devices but could otherwise be the default on Linux. I could toss a quick patch together if this is confusing. It is actually easier than what rxtx does now. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 09:27:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:27:11 +0100 (BST) Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > Hi all. > I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC > microcontroller. The protocol I'm using (which I didn't create) looks like this > for the section of code I'm concerned with: > > PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data > PIC -> PC: 0x01 // ACK > 0xNN // First 8 bits of data > 0xMM // Second 8 bits of data > > I issue ~2000 of these Read commands. The PIC itself has an input fifo which > can store 18 bytes, so I can have 18 read commands in flight at a given time. > The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k > 8N1. > > I am measuring the time it takes to perform these 2000 commands at around 30 > seconds, which is much longer than I anticipated. With the link fully utilized, > I expected: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte > > Time per response transmitted: > ~70 uS/byte * 3 bytes/response = ~210 uS/response > > Time for 2000 responses to be transmitted: > ~210 uS/response * 2000 responses = ~420ms > > I'm a bit new to this, so I may have made some bad asumptions, but I would have > expected a time of a couple of seconds to perform the 2000 reads, not 30+ > seconds. > > I'm obviously missing something here. Can someone help me understand what's > going on? > I've hooked rxtx in loopback with a scope in the past at 9600 baud (baud rate is not important). Using event notification and just writing a byte on event/read the latencey was around 8-12 ms. The JNI is not an efficient way to use native code - especially for bit banging. So if timing is critical you want to move some of the logic into the native code rather than banging over the JNI. 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your performance. C# has advantages here. If you move your logic into the native layer or use gcj (rxtx will work with that too) most of your latency should vanish. You may have to play with some sleeps in eventLoop at that point to get full native efficiency. With gcj all of rxtx becomes 'native code' as java is just treated as a subset of C++. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 09:38:51 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 10:38:51 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: On 6/7/05, Jon Nall wrote: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte of course that should be divided by 10 to account for the start/stop bits, but it barely changes the end results. From carobizar at free.fr Tue Jun 7 10:21:29 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 7 Jun 2005 18:21:29 +0200 Subject: [Rxtx] (no subject) Message-ID: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Hello ! I am a french student and I have to create an application able to read and write on serial and parallel port and to run on Windows and Linux. For the moment my program run on Windows thanks the Java Communication API (version for Microsoft Windows and Solaris/x86). But it doesn't work on Linux. Does a recent version of an installation documentation exist ? I didn't find one on the RXTX site (nothing for the windows installation and the linux installation deals with a "jcl.jar" that I don't know...). So, I have some questions : 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 version or Linux&w32 version ?) What are the differences between them ? Which of them are the most stable ? 2) Where have I to put the .so and .dll files ? 3) What have I to write on the file javax.comm.properties ? 4) Have I to delete the file win32comm.dll included in the Java Comm API ? 5) Have I to keep both comm.jar and RXTXcomm.jar ? Best regards, Caroline. From debief at telemsa.com Tue Jun 7 10:44:56 2005 From: debief at telemsa.com (DEBIEF Eric) Date: Tue, 7 Jun 2005 18:44:56 +0200 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: <200506071844.56656.debief@telemsa.com> Hi, We are "pushing" RxTx /Java here in a half-duplex link. The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC and application handling) about 25?s/byte. The figures are the barely the same on two environments. Environment 1 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Linux 2.6.3, Mdk 10.0. RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : bytes are lost on the wire. I need to investigate this mystery.... Java : 1.4.2-rc1 Blackdown Environment 2 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Windows 2000 Pro RxTx : 2.0.7. Java : 1.4.2_08 SUN I Hope this help, Eric. _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 7 11:05:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:05:45 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, DEBIEF Eric wrote: > Hi, > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. How many write() calls is this? > > Environment 1 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Linux 2.6.3, Mdk 10.0. > RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : > bytes are lost on the wire. I need to investigate this mystery.... > Java : 1.4.2-rc1 Blackdown > > Environment 2 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Windows 2000 Pro > RxTx : 2.0.7. > Java : 1.4.2_08 SUN > In my event/read/write test I found windows was ~20% faster than linux for some reason (strange part is Windows was in VMWare on the same Linux machine). It was about the same rxtx version. There are many problems with rxtx 1.4 with respect to commapi on windows but its code paths are more simple. What some people want from rxtx is perhaps better served by hacking up the very first release as they just want to read and write which is what rxtx was before Sun released commapi. It sounds like perhaps you are pushing out larger writes which will greatly improve results. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 11:16:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:16:49 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118161289.42a5c989cf6a2@imp4-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: On Tue, 7 Jun 2005 carobizar at free.fr wrote: > > Hello ! > > I am a french student and I have to create an application able to read and write > on serial and parallel port and to run on Windows and Linux. > For the moment my program run on Windows thanks the Java Communication API > (version for Microsoft Windows and Solaris/x86). > But it doesn't work on Linux. > > Does a recent version of an installation documentation exist ? > I didn't find one on the RXTX site (nothing for the windows installation and the > linux installation deals with a "jcl.jar" that I don't know...). > > So, I have some questions : > > 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 > version or Linux&w32 version ?) What are the differences between them ? Which > of them are the most stable ? > Use rxtx 2.0 with commapi for sparc solaris from Sun. If you want your current package javax.comm. > 2) Where have I to put the .so and .dll files ? On Linux just use the source, the configure script will do all of that for you. tar -xzvf rxtx-2.0-version mkdir rxtx-2.0-version/build cd rxtx-2.0-version/build ../configure && make install It will do everything for you. With Windows, you need to create the javax.comm.properties and install the DLL on your path. But you can just use Sun's package too. They are intended to be interchangable. > > 3) What have I to write on the file javax.comm.properties ? Driver=gnu.io.RXTXCommDriver More documentation in INSTALL that comes with the source. Sun's documentation should work too. configure does this for you on Linux. > > 4) Have I to delete the file win32comm.dll included in the Java Comm API ? > No > 5) Have I to keep both comm.jar and RXTXcomm.jar ? > Yes. RXTX 2.1 replaces comm.jar but the package is different (gnu.io) to avoid contaminating Sun's namespace. With rxtx 2.0 you need Sun's comm.jar - they work together. > > Best regards, > Caroline. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Tue Jun 7 12:07:34 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 14:07:34 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 Message-ID: <20050607180632.1543A29D5C8@mail.electronpusher.org> Hello, I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our product includes a built in USB to Serial adapter so that when it is connected to your PC over USB, it appears as a serial port. We had problems with Sun's comm library because it did not detect serial ports coming and going properly. I did run into a few issues with RxTx though. I am building under Windows (we support XP and 2000) under cygwin. I used a simple make file for the c code that works under cygwin and ant to build the java stuff. Attached is a diff file. The patches hit the following issues: ParallelImp.c - I am not using config so there is no config.h for me. Also, gcc didn't like a local file (win32termios.h) getting included with <> . RXTXPort.java - You can get an exception during the writeByte, writeArray, nativeDrain, readByte, read, readArray, readTerminatedArray, and nativeAvailable calls. Without this patch the IOLocked count gets stuck incremented. termios.c - If you try to open a port through CreateFile and get ERROR_ACCESS_DENIED it means someone else is using the port. We need to make sure to use serial_close instead of just close. I found that some devices finish their I/O synchronously. The code was treating this as an error. I also added some checking on the ClearError calls. I found a compile error when debugging is turned on (see the usleep change). SerialImp.c - Again, I don't have a config.h and again we must use quotes and not <> to include win32termios.h . I also commented out a report call since it seems to happen constantly on my system. Feel free to use these in any way that you want or just to ignore them. Thanks! -Dave Acker dacker at nomadio.net Software Engineer Nomadio, Inc. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diffs.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/5671d159/diffs-0394.txt From jon.nall at gmail.com Tue Jun 7 12:28:16 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 13:28:16 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, DEBIEF Eric wrote: > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. Hi. This is helpful, thanks. I can think of 2 reasons I'm not collecting the data as fast as I think I should be: 1) the device to PC connection is not at 100% utilization 2) my SerialPortEventListener processing has too much overhead Are there other explanations I might be missing as to why it takes so long to transfer the data? Thanks. nall. From taj at www.linux.org.uk Tue Jun 7 13:21:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:21:46 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > On 6/7/05, DEBIEF Eric wrote: > > We are "pushing" RxTx /Java here in a half-duplex link. > > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > > and application handling) about 25?s/byte. > > The figures are the barely the same on two environments. > > Hi. > This is helpful, thanks. I can think of 2 reasons I'm not collecting > the data as fast as I think I should be: > 1) the device to PC connection is not at 100% utilization > 2) my SerialPortEventListener processing has too much overhead > > Are there other explanations I might be missing as to why it takes so > long to transfer the data? > Polling the port would probably make more sense. You can set the threshold/timeouts to avoid racing and not deal with the event notification. As mentioned earlier I think the event latency is ~10ms. Keep the event listener around, rxtx 2.* does not close well without it. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 13:27:27 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 14:27:27 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, Trent Jarvi wrote: > Polling the port would probably make more sense. You can set the > threshold/timeouts to avoid racing and not deal with the event > notification. As mentioned earlier I think the event latency is ~10ms. Trent, Thanks for the response. Just to make sure I understand what you're talking about, when you say event latency, do you mean the time it takes from when the byte hits the PC's comm port to when rxtx presents it to user code? So if the link is 100% utilized, will my user code see "hiccups" or a steady stream of data? Thanks for helping a serial port newbie. nall. From dacker at nomadio.net Tue Jun 7 13:32:20 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 15:32:20 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <20050607193118.5499329CAA0@mail.electronpusher.org> Some folks asked about the make file and ant steps. I have JAVA_HOME set as follows: $ echo $JAVA_HOME C:\Program Files\Java\jdk1.5.0_01 I have all the code in rxtx/src put into gnu/io . The make file here doesn't have optimizations turned on. We have not tested with it yet. --------------Begin Makefile------------------ CPPFLAGS="-I$(JAVA_HOME)/include" "-I$(JAVA_HOME)/include/win32" SOBJECTS=SerialImp.o fuserImp.o termios.o fixup.o init.o POBJECTS=ParallelImp.o termios.o init.o DLLS=rxtxParallel.dll rxtxSerial.dll all: $(CLASSES) $(DLLS) rxtxSerial.dll: $(SOBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(SOBJECTS) rxtxParallel.dll: $(POBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(POBJECTS) clean: rm -fv $(SOBJECTS) $(POBJECTS) $(DLLS) %.o: %.c gcc -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< %.o: %.cpp g++ -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< --------------End Makefile------------------ Here is the ant target I use to build the rxtx libs. Our build puts the class files in a bin dir. We copy the dlls to a deploy dir and to the build dir. Eclipse seems to like the dlls in the build dir. The deploy dir is used when we build our full package. --------------Begin Ant Section------------------ --------------End Ant Section------------------ > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > David S. Acker > Sent: Tuesday, June 07, 2005 2:08 PM > To: 'Java RXTX discussion' > Subject: [Rxtx] Patches to 2.1-7pre17 > > Hello, > I am using RxTx with the Nomadio Sensor, > http://www.nomadio.net/ . Our product includes a built in > USB to Serial adapter so that when it is connected to your PC > over USB, it appears as a serial port. We had problems with > Sun's comm library because it did not detect serial ports > coming and going properly. > > I did run into a few issues with RxTx though. I am building > under Windows (we support XP and 2000) under cygwin. I used > a simple make file for the c code that works under cygwin and > ant to build the java stuff. Attached is a diff file. The > patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h > for me. Also, gcc didn't like a local file (win32termios.h) > getting included with <> . > > RXTXPort.java - You can get an exception during the > writeByte, writeArray, nativeDrain, readByte, read, > readArray, readTerminatedArray, and nativeAvailable calls. > Without this patch the IOLocked count gets stuck incremented. > > termios.c - If you try to open a port through CreateFile and > get ERROR_ACCESS_DENIED it means someone else is using the > port. We need to make sure to use serial_close instead of > just close. I found that some devices finish their I/O > synchronously. The code was treating this as an error. I > also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we > must use quotes and not <> to include win32termios.h . I > also commented out a report call since it seems to happen > constantly on my system. > > Feel free to use these in any way that you want or just to > ignore them. > Thanks! > > -Dave Acker > dacker at nomadio.net > Software Engineer > Nomadio, Inc. > From taj at www.linux.org.uk Tue Jun 7 13:37:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:37:45 +0100 (BST) Subject: [Rxtx] Re: Stack Smashing Attack In-Reply-To: <200506072012.48860.ferdinand.tatzig@web.de> References: <200506072012.48860.ferdinand.tatzig@web.de> Message-ID: On Tue, 7 Jun 2005, Ferdinand Tatzig wrote: > Dear Trent > > I am using RXTX for serial port communication between a PC and a payment > transaction terminal. > When I run my application under Windows 2000, an i386-Linux or an i386-FreeBSD > it works as I expect it to do. However, when I start it to run on AMD64 > machine with a 64-bit Gentoo Linux, the VM terminates with the following > error: > > Port found: /dev/ttyS0 > java: stack smashing attack in function configure_port() > > I am using a 64-bit Blackdown-1.4.2-01 VM. > > I have searched the internet but have found no information about this error. > > This is the code of the method which initializes the serial port: > > /** > * initializes a serial port for communication with a terminal; only > * accessible within this class > * > * @param communication > * @param serialPortToBeInitialized > * @param tillInterfaceEventListener > */ > private TillInterfaceSerialPort(Communication communication, > String serialPortToBeInitialized, > TillInterfaceEventListener tillInterfaceEventListener) > throws IOException, PortInUseException, > TillInterfaceSerialPortNotFoundException, > TooManyListenersException, UnsupportedCommOperationException { > serialPortName = "not initialized yet"; > CommPortIdentifier portId = null; > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > boolean portFound = false; > String temporarySerialPortName = "not initialized yet"; > > // look for a serial port > while (portList.hasMoreElements() && !portFound) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > temporarySerialPortName = portId.getName(); > if (temporarySerialPortName.equals(serialPortToBeInitialized)) { > System.out.print("Port found: "); > System.out.println(temporarySerialPortName); > serialPortName = temporarySerialPortName; > portFound = true; > } > } > } > if (portFound) { > > // initialize the found port - this command causes the VM to terminate > serialPort = (SerialPort) portId > .open( > TillInterfaceConstants.APPLICATION_NAME, > TillInterfaceConstants > .TIMEOUT_IN_MILLISECONDS_FOR_OPENING_OF_COMMUNICATION_PORT); > > // add an event listener which listens > // on the serial port and notifies the > // serial port object when input bytes > // have been received at the port > serialPort.addEventListener(tillInterfaceEventListener); > serialPort.notifyOnDataAvailable(true); > > // initialize the physical layer > // parameters of the serial port > serialPort.setSerialPortParams(TillInterfaceConstants.BAUD_RATE, > SerialPort.DATABITS_8, SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > // set the inter-character > // timeout (T2) > serialPort > .enableReceiveTimeout(TillInterfaceConstants.INTERCHARACTER_TIMEOUT_IN_MILLISECONDS); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > } else > throw new TillInterfaceSerialPortNotFoundException(); > } > > Any hint to solve this problem would be kindly appreciated. > The only thing that comes to mind here after looking at the offending function is rxtx used to include asm/termios.h but now we moved to termios.h and had glibc fix their headers. The asm/termios.h caused problems as its termios was smaller than the actual termios. This should be fixed in current rxtx versions but you can just glance at SerialImp.c and make sure it does not include asm/termios.h. I've cc'd the rxtx mail list because there was one other mention of stack problems recently. I have used rxtx on opteron systems with success. I have a bug I'm trying hard to reproduce on suse 64 bit (circa linux 2.4.19) systems though. So far I have not been able to reproduce the bug. That said, with gentoo... I like gentoo but I seriously doubt they do any QA with their kernel and Java. I've seen problems before. If you use gentoo and have Java problems, at least stick to Linus (that is an s there) kernels while using Java. I'm not an expert on gentoo but I've seen patches go into experimental kernels that turn out to break java and are reverted before going to Linus just before I see problems with gentoo on this list. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:16:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:16:14 +0100 (BST) Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: On Tue, 7 Jun 2005, David S. Acker wrote: > Hello, > I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our > product includes a built in USB to Serial adapter so that when it is > connected to your PC over USB, it appears as a serial port. We had problems > with Sun's comm library because it did not detect serial ports coming and > going properly. > > I did run into a few issues with RxTx though. I am building under Windows > (we support XP and 2000) under cygwin. I used a simple make file for the c > code that works under cygwin and ant to build the java stuff. Attached is a > diff file. The patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h for me. Also, > gcc didn't like a local file (win32termios.h) getting included with <> . > > RXTXPort.java - You can get an exception during the writeByte, writeArray, > nativeDrain, readByte, read, readArray, readTerminatedArray, and > nativeAvailable calls. Without this patch the IOLocked count gets stuck > incremented. > > termios.c - If you try to open a port through CreateFile and get > ERROR_ACCESS_DENIED it means someone else is using the port. We need to > make sure to use serial_close instead of just close. I found that some > devices finish their I/O synchronously. The code was treating this as an > error. I also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we must use quotes > and not <> to include win32termios.h . I also commented out a report call > since it seems to happen constantly on my system. > > Feel free to use these in any way that you want or just to ignore them. > Thanks! > Hi Dave These patches look great as is. Thanks. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:33:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:33:16 +0100 (BST) Subject: [Rxtx] Patch to IOLocked (fwd) Message-ID: This appears to be another solution to the locking. Chris, the other option just moves the locking into the finally clause which I think would be a little cleaner though I'm posting this patch to so people can comment. -- Trent Jarvi tjarvi at qbang.org ---------- Forwarded message ---------- Date: Wed, 1 Jun 2005 13:01:32 +0100 From: Christopher Dawes To: taj at www.linux.org.uk Subject: Patch to IOLocked Do you want me to check it out of CVS and then submit changes? Christopher -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXPort.java.diff Type: application/octet-stream Size: 6965 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/c442f9fc/RXTXPort.java-0397.obj From Christopher.Dawes at retail-logic.com Wed Jun 8 00:57:24 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 8 Jun 2005 07:57:24 +0100 Subject: [Rxtx] Patch to IOLocked (fwd) [Virus Checked] In-Reply-To: Message-ID: Agreed, much better Java :-) Thanks Christopher ------------------------------------------- Consultant Engineer Retail Logic Limited Fleet GU51 3TZ Tel: +44 (0)1252 644377 Mob: +44 (0)7899 842759 Fax: +44 (0)1252 776708 rxtx-bounces at mail.electronpusher.org wrote on 07/06/2005 21:33:16: > > This appears to be another solution to the locking. Chris, the other > option just moves the locking into the finally clause which I think would > be a little cleaner though I'm posting this patch to so people can > comment. > > -- > Trent Jarvi > tjarvi at qbang.org > > ---------- Forwarded message ---------- > Date: Wed, 1 Jun 2005 13:01:32 +0100 > From: Christopher Dawes > To: taj at www.linux.org.uk > Subject: Patch to IOLocked > > Do you want me to check it out of CVS and then submit changes? > > Christopher[attachment "RXTXPort.java.diff" deleted by Chris > Dawes/Retaillogic/NISABA] _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx From zempftman at gmail.com Wed Jun 8 07:57:25 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 09:57:25 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Maxwell Zempftman Date: May 27, 2005 5:01 PM Subject: Re: [Rxtx] Kaffe & rxtx & armv5b To: rxtx at mail.linuxgrrls.org Here are the results from working this week: The "NullPointerExceptions" are generated by the software when I choose a bad device file. I discovered that this occurs on the i686-RedHat box as well. This exception seems to be generated only by this particular application, and not by the example programs in contrib. So, for example: java MyApp /dev/null <-- generates NullPointerException java MyApp fake <-- generates NullPointerException java MyApp /dev/ttyS0 <-- does not generate NullPointerException Using the program CommCheck (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it appears as though /dev/ttyS0 is the only valid serial device file on the XScale device, so the errors I was getting are not really be bugs. Although /dev/ttyS0 did not generate NullPointerExceptions, I did encounter this error: --start java MyApp /dev/ttyS0 (going mostly from memory, not exact) PortList.hasMoreElements: true Listening on: /dev/ttyS0 Client connected. >From net: echo kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 vmExcept_setJNIFrame Assert: on 'fp != 0' failed. --end I took a look at exception.h, and it seems as though the problematic code does not exist in newer versions of Kaffe (I have been using CVS-2004-11). Next week I will try to use a newer version, although so far everything but CVS-2004-11 has failed. Also, I the device files I need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with something like this? Thanks, Max. > On 5/21/05, Trent Jarvi wrote: > > I'm not sure what is wrong in the first part. It sounds like your > > application may be swallowing an exception while trying to enumerate the > > port or open it. The usual mistake made it not having permissions to > > either open the port or create the lockfile. There should be examples in > > the contrib directory you can try that enumerate and open ports. Maybe > > that will give you some hints. > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > Sun's code limiting you there though you do need to compile and install > > rxtx for the XScale with Sun's Commapi. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > From taj at www.linux.org.uk Wed Jun 8 08:22:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 15:22:44 +0100 (BST) Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > ---------- Forwarded message ---------- > From: Maxwell Zempftman > Date: May 27, 2005 5:01 PM > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > To: rxtx at mail.linuxgrrls.org > > > Here are the results from working this week: > > The "NullPointerExceptions" are generated by the software when I > choose a bad device file. I discovered that this occurs on the > i686-RedHat box as well. This exception seems to be generated only by > this particular application, and not by the example programs in > contrib. So, for example: > > java MyApp /dev/null <-- generates NullPointerException > java MyApp fake <-- generates NullPointerException > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > Using the program CommCheck > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > appears as though /dev/ttyS0 is the only valid serial device file on > the XScale device, so the errors I was getting are not really be bugs. > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > encounter this error: > > --start > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > PortList.hasMoreElements: true > Listening on: /dev/ttyS0 > Client connected. > >From net: echo > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > --end > > I took a look at exception.h, and it seems as though the problematic > code does not exist in newer versions of Kaffe (I have been using > CVS-2004-11). Next week I will try to use a newer version, although so > far everything but CVS-2004-11 has failed. Also, I the device files I > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > something like this? > In RXTXCommDriver, just look for the following code and add /dev/ttyM to the list. Moxa? if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } So: if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyM", // for Moxa ports "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } Linux just has way too many port types to try enumerating them all. There is potential we can add them back in with udev now. > Thanks, > Max. > > > On 5/21/05, Trent Jarvi wrote: > > > I'm not sure what is wrong in the first part. It sounds like your > > > application may be swallowing an exception while trying to enumerate the > > > port or open it. The usual mistake made it not having permissions to > > > either open the port or create the lockfile. There should be examples in > > > the contrib directory you can try that enumerate and open ports. Maybe > > > that will give you some hints. > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > Sun's code limiting you there though you do need to compile and install > > > rxtx for the XScale with Sun's Commapi. > > > > > > -- > > > Trent Jarvi > > > tjarvi at qbang.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Wed Jun 8 12:16:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 08 Jun 2005 13:16:03 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A60B8D.8080500@cs.umn.edu> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> Message-ID: <42A735E3.8040706@atcorp.com> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual serial comport. This isn't so much of a problem, what is, however, is that the comport does not appear to be able to be set to any arbitrary speed, only those from the data_rate enum. I've not found much on using different speeds, has anyone else encountered anything similar? I greatly appreciate any and all comments and suggestions. Thanks in advance, ~ Shawn Lavelle From zempftman at gmail.com Wed Jun 8 12:50:58 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 14:50:58 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: Thanks Trent! That will solve one of the problems. I don't know when my next chance to work on it will be, but I still need to figure out the error I got when I tried opening '/dev/ttyS0' on the Moxa device regarding a failed assertion, seemed to be a Kaffe issue. Thanks for you help, hope to have results soon, Max Englander. On 6/8/05, Trent Jarvi wrote: > On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > > > ---------- Forwarded message ---------- > > From: Maxwell Zempftman > > Date: May 27, 2005 5:01 PM > > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > > To: rxtx at mail.linuxgrrls.org > > > > > > Here are the results from working this week: > > > > The "NullPointerExceptions" are generated by the software when I > > choose a bad device file. I discovered that this occurs on the > > i686-RedHat box as well. This exception seems to be generated only by > > this particular application, and not by the example programs in > > contrib. So, for example: > > > > java MyApp /dev/null <-- generates NullPointerException > > java MyApp fake <-- generates NullPointerException > > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > > > Using the program CommCheck > > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > > appears as though /dev/ttyS0 is the only valid serial device file on > > the XScale device, so the errors I was getting are not really be bugs. > > > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > > encounter this error: > > > > --start > > > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > > > PortList.hasMoreElements: true > > Listening on: /dev/ttyS0 > > Client connected. > > >From net: echo > > > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > > > --end > > > > I took a look at exception.h, and it seems as though the problematic > > code does not exist in newer versions of Kaffe (I have been using > > CVS-2004-11). Next week I will try to use a newer version, although so > > far everything but CVS-2004-11 has failed. Also, I the device files I > > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > > something like this? > > > > > In RXTXCommDriver, just look for the following code and add /dev/ttyM to > the list. Moxa? > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > So: > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyM", // for Moxa ports > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > Linux just has way too many port types to try enumerating them all. There > is potential we can add them back in with udev now. > > > > > Thanks, > > Max. > > > > > On 5/21/05, Trent Jarvi wrote: > > > > I'm not sure what is wrong in the first part. It sounds like your > > > > application may be swallowing an exception while trying to enumerate the > > > > port or open it. The usual mistake made it not having permissions to > > > > either open the port or create the lockfile. There should be examples in > > > > the contrib directory you can try that enumerate and open ports. Maybe > > > > that will give you some hints. > > > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > > Sun's code limiting you there though you do need to compile and install > > > > rxtx for the XScale with Sun's Commapi. > > > > > > > > -- > > > > Trent Jarvi > > > > tjarvi at qbang.org > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- > Trent Jarvi > tjarvi at qbang.org > From taj at www.linux.org.uk Wed Jun 8 12:53:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 19:53:10 +0100 (BST) Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A735E3.8040706@atcorp.com> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: On Wed, 8 Jun 2005, Shawn Lavelle wrote: > Hello, > I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate > with a virtual serial comport. This isn't so much of a problem, what > is, however, is that the comport does not appear to be able to be set to > any arbitrary speed, only those from the data_rate enum. I've not found > much on using different speeds, has anyone else encountered anything > similar? I greatly appreciate any and all comments and suggestions. > This problem is a bit more tricky than it should be. POSIX systems just have a few specified baud rates. Solaris is one of these systems. CommAPI baud rates probably came from someone looking at Solaris. RXTX tries to be POSIX like. W32 is treated as a POSIX like system via a termios.c file in rxtx. Serial ports have baudbase and divisor. So you can set these to come close to the baudrate you want. Some funky equipment like automobile test equipment use baud rates that are not really possible with PC hardware. But if you get as close as possible by changing baud base and divisor, it works. Windows can actually do this for you. I don't know exactly what their code does but if you pass a baudrate to windows, it will guestimate a baudbase and divisor. So you just pass it 10200 baud and it does its job. This is not of very much use the way rxtx does things though. Linux has the standard POSIX like baud rates but if you set the baud rate to B38400, you can set your own baud base and divisor. This is not POSIX that I know of. W32 has more capability than POSIX like systems too. So I did some work to have windows work like Linux via termios.c But the code is not quit right. SerialImp.c and termios.c need some work so all the various buadrates work on Linux and W32. Most other systems will not work beyond what CommAPI already specifies without writting kernel drivers. This is on my todo list but if someone gets to it first, all the better. -- Trent Jarvi tjarvi at qbang.org From carobizar at free.fr Thu Jun 9 06:39:10 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Thu, 9 Jun 2005 14:39:10 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: <1118320750.42a8386e6d3ce@imp5-q.free.fr> Hi ! Thank you for all your advices. I managed to use rxtx on Windows but I have still some difficulties on Linux. I have yet follow your instructions and the configure file has created : - librxtxSerial.so and librxtxParallel.so in the directory /usr/java/j2sdk1.4.2_08/jre/lib/i386 - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the directory /usr/java/j2sdk1.4.2_08/jre/lib - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext But when I run my program, Some exceptions occur : Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver So, 1) What have I forgotten ? 2) Is it possible to make my application run on Linux without the jdk (only the jre) ? Best regards, Caroline. From taj at www.linux.org.uk Thu Jun 9 07:28:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 9 Jun 2005 14:28:05 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118320750.42a8386e6d3ce@imp5-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: On Thu, 9 Jun 2005 carobizar at free.fr wrote: > Hi ! > Thank you for all your advices. > I managed to use rxtx on Windows but I have still some difficulties on Linux. > I have yet follow your instructions and the configure file has created : > - librxtxSerial.so and librxtxParallel.so in the directory > /usr/java/j2sdk1.4.2_08/jre/lib/i386 > - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the > directory /usr/java/j2sdk1.4.2_08/jre/lib > - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext > > But when I run my program, Some exceptions occur : > Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while > loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > com.sun.comm.SolarisDriver > > So, > 1) What have I forgotten ? > The native (.so) libraries are not installed in a directory the JRE is looking for native libraries in. You may look around and see where the .so libraries are in the JRE. I don't know that the jre/lib/i386 directory is specified as a required directory for JREs. I noticed some do not use it. You may try printing the java.libarary.path to see your options. It is also possible to alter the java.library.path. > 2) Is it possible to make my application run on Linux without the jdk (only the > jre) ? Yes. Though installation from source with the JDK is less error prone. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0394.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 7 15:03:09 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 07 Jun 2005 16:03:09 -0500 Subject: [Rxtx] Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <42A60B8D.8080500@cs.umn.edu> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual comport. This isn't so much of a problem, what is, however, is that the comport is only ever set to 9600 baud. I've not found this as a documented bug, has anyone else encountered anything similar? I'll try and provide more detail tomorrow, but if anyone has any suggestions or encountered this before, I'd like to hear about it. Thanks in advance, ~ Shawn Lavelle From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0397.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0397.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0397.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Mon Jun 20 01:04:40 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 20 Jun 2005 08:04:40 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: <42B66A88.4060806@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050620/9be208a1/attachment-0397.html From fbalzarro at libero.it Mon Jun 20 02:33:52 2005 From: fbalzarro at libero.it (Fabio Balzarro) Date: Mon, 20 Jun 2005 10:33:52 +0200 Subject: [Rxtx] RXTXPort:close detected bad file descriptor Message-ID: I'm using RXTX libraries on IPAQ 4150 PDA with Windows CE 4.20 and Jeode. When I close a serial port with sp.close() (where sp is a SerialPort) sometimes an error occour 1119256168085: RXTXPort:close detected bad file descriptor What can I do? Thanks Fabio ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From slavelle at atcorp.com Mon Jun 20 08:08:19 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 20 Jun 2005 09:08:19 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: <42B6CDD3.4040409@atcorp.com> It turns out that I did have a driver-not-used issue which has now been resolved and I can use RxTx on it (had to add ttyUSB as a valid port), but only at standard baud rates. Does USB have the same restrictions on port speed as regular RS232? ~ Shawn Trent Jarvi wrote: > Just a note here. > > I have requested a FTDI usb device and they offered to send one for the > purpose of trying to get rxtx working. I have no idea how long that takes > though. > > > On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > > >>I'm afraid we're just using the latest version from the FTDI website. I've >>not yet played with linux properly with this and unfortunately I run gentoo >>and haven't yet successfully compiled in the ftdi driver. I'll let you know >>if I get any success. >> >>Appologies >> >>Christopher >> >>-----Original Message----- >>From: rxtx-bounces at mail.electronpusher.org >>[mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle >>Sent: 15 June 2005 00:00 >>To: Java RXTX discussion >>Subject: Re: [Rxtx] Virtual Com Ports >> >>Hmm, the latter sounds like a lot of work. It does find the virtual comport >>in windows, i must have just missed it earlier (sign of a long day). On the >>linux side, I suspect that something is not correct with the driver >>installation becuase it does not give me a tty for it :( >> >>Christopher, May I ask what driver you are using for your FTDI chip? >>Did you ever encounter problems with not getting a tty assigned for it? >> >> >> Thanks for all your help! >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>They will have to show up as a tty device in Linux. Probably ttyUSB? >>>That will need an entry in RXTXCommDriver.java. If they dont show up >>>as a tty device, rxtx cant treat it like a serial port. It just wont >> >>work. >> >>>With COM3, rxtx will try to open the port and perform a timed out read. >>>Usually if a port is not there, the read blows up or the open blows up. >>>Timing out is fine. COM3 used to share interrupts with COM1. I know >>>you can reassign ports in XP. RXTX scans up through COM255. You may >>>try moving it. >>> >>> >>>The code in question is the following in RXTXCommDriver.java >>> >>> >>> if(osName.equals("Linux")) >>> { >>> String[] Temp = { >>> "ttyS", // linux Serial Ports >>> "ttySA", // for the IPAQs >>> "ttyUSB" // for USB frobs >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>> else if(osName.toLowerCase().indexOf("windows") != -1 ) >>> { >>> String[] Temp = { >>> "COM" // win32 serial ports >>> //"//./COM" // win32 serial ports >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>>If COM3 can be read, it should be found. the ttyUSB should work if >>>thats in the version of RXTXCommDriver.java you have. >>> >>>If this is still a problem, it may be that the driver is erroring on >>>what may be considered normal comm port operations such as setting the >>>speed, timeout, threshold, .. One would have to start looking at each >>>function called in the native open() and read(). >>> >>> >>> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>>seems to find the device using rxtx. Looking at the hardware >>>>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>>>linux. I can't seem to get it to show up as a tty(s#) in linux which >>>>is probably just due to my lack of significant linux knowledge. >>>> >>>> ~ Shawn >>>> >>>>Trent Jarvi wrote: >>>> >>>> >>>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>Has anyone here noticed that virtual comports do not get enumerated >>>>>>via CommPortIdentifier.getPortIdentifiers()?? >>>>>> >>>>>>The device I'm trying to talk to uses an fdti usb to serial >>>>>>convertor with a driver that has it show up as a virtual comport. I >>>>>>can enter this port manually and it will be usable but I cannot get >>>>>>it show up automatically (as in the simple serial demo). Any thoughts >> >>on this? >> >>>>> >>>>>Hi Shawn, >>>>> >>>>>What OS is this and what is the name of the virtual port you are >>>>>trying to open? I suspect the name just needs to be added to >> >>RXTXCommDriver.java. >> >>>>_______________________________________________ >>>>Rxtx mailing list >>>>Rxtx at mail.electronpusher.org >>>>http://www.electronpusher.org/mailman/listinfo/rxtx >>>> >>> >>> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From lyon at docjava.com Mon Jun 20 15:06:08 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 20 Jun 2005 17:06:08 -0400 Subject: [Rxtx] testing Message-ID: Hi All, I am testing my new multi-platform Java Webstart RXTX application (Trent: I could not have done it without you!). So far, I think it will work under Linux (x86), Windows XP, Windows 2000 and MacOS X. The application is available as a Java webstart application at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Edit:Preferences: SerialPort Setup... should bring up a dialog box that enables dialing via the modem. Generally, it does not find internal modems (except on the mac). Why, I don't know. Thanks in advance for trying this new app. All feedback on it is welcome. - Doug Lyon From jasmine at electronpusher.org Tue Jun 21 04:15:53 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Tue, 21 Jun 2005 11:15:53 +0100 Subject: [Rxtx] testing In-Reply-To: References: Message-ID: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > Hi All, > I am testing my new multi-platform Java Webstart RXTX application > (Trent: I could not have done it without you!). > > So far, I think it will work under Linux (x86), Windows XP, > Windows 2000 and MacOS X. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. -J. From taj at www.linux.org.uk Tue Jun 21 05:50:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 12:50:23 +0100 (BST) Subject: [Rxtx] testing In-Reply-To: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> References: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> Message-ID: On Tue, 21 Jun 2005, Jasmine Strong wrote: > > On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > > > Hi All, > > I am testing my new multi-platform Java Webstart RXTX application > > (Trent: I could not have done it without you!). > > > > So far, I think it will work under Linux (x86), Windows XP, > > Windows 2000 and MacOS X. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > on my Mac. > passing -source 1.3 -target 1.3 to javac will compile classes without this problem. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 10:19:25 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 11:19:25 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. Sincerely, Jeremyah Payne From ricardo.trindade at emation.pt Tue Jun 21 13:25:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 20:25:00 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B8698C.2060509@emation.pt> Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > From taj at www.linux.org.uk Tue Jun 21 13:39:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:39:43 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <42B8698C.2060509@emation.pt> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> <42B8698C.2060509@emation.pt> Message-ID: It looks like he has an rs422 device/converter. This is not the problematic 'trying to do protocol X with a serial port' situation unless I'm missing something. I'll follow up with the other email I started. On Tue, 21 Jun 2005, Ricardo Trindade wrote: > Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. > > Payne, Jeremyah L (N-CIM) wrote: > > >Good morning, my name is Jeremyah and I am working on a java project to > >interface with some devices. In short, I have a laptop with a PCMIA > >converter that does RS422 running windows 2000. I also will be > >installing some PCI cards into some Linux boxes that will have probably > >4-8 RS422 ports on them. After doing some reading in order to talk > >with these items using my existing java code I will need an additional > >driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > >trying to get a map sort of where I need to make changes. As I see it, > >I would need to subclass SerialPort to my RS422 interface. That would > >link with a DLL or SO implementation that talks with the hardware. I > >also need to change the listing of working ports in the lookup section > >for serial. Does this seem like I am on the right track? Appreciate > >the support. > > > > > >Sincerely, > >Jeremyah Payne > >_______________________________________________ > >Rxtx mailing list > >Rxtx at mail.electronpusher.org > >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 21 13:40:25 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:40:25 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: On Tue, 21 Jun 2005, Payne, Jeremyah L (N-CIM) wrote: > Good morning, my name is Jeremyah and I am working on a java project to > interface with some devices. In short, I have a laptop with a PCMIA > converter that does RS422 running windows 2000. I also will be > installing some PCI cards into some Linux boxes that will have probably > 4-8 RS422 ports on them. After doing some reading in order to talk with > these items using my existing java code I will need an additional > driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > trying to get a map sort of where I need to make changes. As I see it, I > would need to subclass SerialPort to my RS422 interface. That would link > with a DLL or SO implementation that talks with the hardware. I also > need to change the listing of working ports in the lookup section for > serial. Does this seem like I am on the right track? Appreciate the > support. > Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 13:40:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 14:40:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618954@emss02m08.us.lmco.com> I'd like to except I am dealing with NASA. I am basically building a system to monitor 100+ Units that communicate over RS422. They have some converters in place but want to get rid of them. I'll check through the archives. I had started looking yesterday as was leaving work. -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Ricardo Trindade Sent: Tuesday, June 21, 2005 2:25 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From slavelle at atcorp.com Tue Jun 21 14:58:06 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 21 Jun 2005 15:58:06 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: <42B87F5E.4000403@atcorp.com> > Linux has the standard POSIX like baud rates but if you set the baud rate > to B38400, you can set your own baud base and divisor. This is not POSIX > that I know of. W32 has more capability than POSIX like systems too. So > I did some work to have windows work like Linux via termios.c > > But the code is not quit right. SerialImp.c and termios.c need some > work so all the various buadrates work on Linux and W32. Most other > systems will not work beyond what CommAPI already specifies without > writting kernel drivers. > > This is on my todo list but if someone gets to it first, all the better. Hmm, I guess I didn't read this close enough before. Just to be clear, the pieces to setBaudBase and setDivisor are not yet implemented, correct? Thanks, Shawn From sean_montgomery at baseview.com Tue Jun 21 15:14:08 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 21 Jun 2005 17:14:08 -0400 Subject: [Rxtx] OS X installation - file locations Message-ID: <8AB82C7F-0D19-45F9-AE54-A12C59A8495E@baseview.com> Greetings, I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) using the RXTX installation instructions. RXTX worked fine. Basically you've got: - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions - javax.comm.properties in /System/Library/Frameworks/ JavaVM.framework/Home/lib - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ lib/ext My coworker was concerned that the installation required files to be placed in /System/Library... because those directories are "Apple's" and subject to change at Apple's whim, and that it would be safer (less likely to break when a user updates their OS or Java version or what have you) if all the files could be somewhere in /Library... or / Library/Java. My coworker points out that when 3rd party apps like FrontBase and JBoss need to communicate with Java their jars are placed in /Library/Java/Extensions. Granted that RXTX 2.0 is implementing javax.comm and not just a 3rd party extension, might that be the case - that javax.* stuff needs to be in the Java system files? I'm not the Java maven that my coworker is, so I don't know if any of this is gospel or not. Any OS X/Java experts out there willing to comment? We'd like to be able to install RXTX in the safest, most maintenance free way possible, but if there are specific reasons why javax.comm.properties and comm.jar need to be in /System... then so be it. Any information is welcome, Sean From ricardo.trindade at emation.pt Tue Jun 21 15:56:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 22:56:53 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B88D25.7060604@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050621/f6c9f5fe/attachment-0397.html From jeremyah.l.payne at lmco.com Tue Jun 21 15:22:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 16:22:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618955@emss02m08.us.lmco.com> -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Trent Jarvi Sent: Tuesday, June 21, 2005 2:40 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 As of yet we have not decided on the PCI boards to use yet So I am still waiting to se how we will interface to them. But the laptop is ready to use so ill build a test app for that API for now. The overview of class structure is really what I needed. I guess I will use the 2.1 as you suggested. Thanks for the help thus far! BTW, you guys wouldn't happen to keep class diagrams or anything of that nature around would you? If not I will probably end up having to do some anyway for documentation purposes, I could include them. Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From dmarkman at mac.com Tue Jun 21 18:13:28 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 21 Jun 2005 20:13:28 -0400 Subject: [Rxtx] OS X installation - file locations In-Reply-To: References: Message-ID: <044F520C-585C-4B99-82ED-3BA83DB8CE77@mac.com> Apple doesn't recommend to put jars into the /System/Library/Frameworks/JavaVM.framework/Home/lib/ext folder from other hands it's standard java directory to put extentions if you want to support comm api on whole system then I'd recommend to put jars into the /Library/Java/Extensions folder just like you did if you want to support comm api per user put your jars into the ~/ Library/Java/Extensions On Jun 21, 2005, at 5:14 PM, Java RXTX discussion wrote: > Greetings, > > > I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) > using the RXTX installation instructions. RXTX worked fine. > > > Basically you've got: > - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions > - javax.comm.properties in /System/Library/Frameworks/ > JavaVM.framework/Home/lib > - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ > lib/ext > > > My coworker was concerned that the installation required files to be > placed in /System/Library... because those directories are "Apple's" > and subject to change at Apple's whim, and that it would be safer > (less likely to break when a user updates their OS or Java version or > what have you) if all the files could be somewhere in /Library... or / > Library/Java. My coworker points out that when 3rd party apps like > FrontBase and JBoss need to communicate with Java their jars are > placed in /Library/Java/Extensions. Granted that RXTX 2.0 is > implementing javax.comm and not just a 3rd party extension, might > that be the case - that javax.* stuff needs to be in the Java system > files? > > > I'm not the Java maven that my coworker is, so I don't know if any of > this is gospel or not. Any OS X/Java experts out there willing to > comment? We'd like to be able to install RXTX in the safest, most > maintenance free way possible, but if there are specific reasons why > javax.comm.properties and comm.jar need to be in /System... then so > be it. > > > Any information is welcome, > > > Sean > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Dmitry Markman Dmitry Markman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050622/beea65d0/attachment-0397.html From lyon at docjava.com Thu Jun 23 04:39:47 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 23 Jun 2005 06:39:47 -0400 Subject: [Rxtx] web start + RXTX = strange errors? Message-ID: On: Date: Tue, 21 Jun 2005 11:15:53 +0100 From: Jasmine Strong Writes: An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. ----------- I cannot duplicate your error. My version of Java is: java -version java version "1.4.2_05" Is yours the same? Trent: You wrote: passing -source 1.3 -target 1.3 to javac will compile classes without this problem. ----------- OK, I have updated the disto to work with jdk1.3: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Jasmine: Is this working any better? Thanks! - DL From handzisk at tkn.tu-berlin.de Fri Jun 24 02:37:14 2005 From: handzisk at tkn.tu-berlin.de (Vlado Handziski) Date: Fri, 24 Jun 2005 10:37:14 +0200 (CEST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace Message-ID: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Hi all, let me first express my compliments on the great work you have done with the RXTX library. We have been using the library for some time, and we are at a point where we want to make our code public. For legacy reasons, the code that the RXTX library is bundled with, uses the javax.comm namespace. We have been using the ChangePackage script to change the RXTX2.1 package from gnu.io into javax.comm. We need the independent implementation since we want to be able to directly access /dev/ttyUSBx ports in linux and the CommAPI versions are just not as stable. On the download page, there is a comment that this is in violation of sun's license. Can someone shed more light on this. I was not aware that you can protect the names of the java packages. Best regards, Vlado From ricardo.trindade at emation.pt Fri Jun 24 04:01:17 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 11:01:17 +0100 Subject: [Rxtx] parity missed Message-ID: <42BBD9ED.3060004@emation.pt> Hi, I have a "parity missed error". From previous posts I believe this has to do with CMSPAR not being defined. I checked out 2.1 head from CVS. How can I make sure I do a proper build and CMSPAR is defined ? Perhaps it would be good to have a release snapshot that has this, I think the latest snapshot (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. Another question I have, is why must this depend on kernel headers, why can't it be defined in the RXTX source ? thanks Ricardo From jasmine at electronpusher.org Fri Jun 24 04:09:06 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 24 Jun 2005 11:09:06 +0100 Subject: [Rxtx] web start + RXTX = strange errors? In-Reply-To: References: Message-ID: <644aad2bdbba950f0a2fb12d7dcfd8a6@electronpusher.org> On 23 Jun 2005, at 11:39, Dr. Douglas Lyon wrote: > OK, I have updated the disto to work with jdk1.3: > http://show.docjava.com:8086/book/cgij/code/jnlp/ > addbk.JAddressBook.Main.jnlp > > Jasmine: Is this working any better? Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) -J. From taj at www.linux.org.uk Fri Jun 24 10:54:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 17:54:12 +0100 (BST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: On Fri, 24 Jun 2005, Vlado Handziski wrote: > Hi all, > > let me first express my compliments on the great work you have done with > the RXTX library. > > We have been using the library for some time, and we are at a point where > we want to make our code public. For legacy reasons, the code that the > RXTX library is bundled with, uses the javax.comm namespace. We have been > using the ChangePackage script to change the RXTX2.1 package from gnu.io > into javax.comm. We need the independent implementation since we want to > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > versions are just not as stable. > > On the download page, there is a comment that this is in violation of > sun's license. Can someone shed more light on this. I was not aware that > you can protect the names of the java packages. > > Best regards, > Vlado > I can't provide legal advice as I am not a lawyer. (v) may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are contained in the "java", "javax" or "sun" packages or similar as specified by Sun in any class file naming convention; and The license is in the commapi package from Sun. The above is also in all the EULA's you click through to download from Sun if I'm not mistaken. Simply put, the license taints developers that agree to it. For those developers, Sun has control of the javax.comm namespace. It really does not make sense to put rxtx 2.1 in the javax.comm namespace. It will only cause confusion which I think is the point of the clause above. The gnu.io namespace was perhaps a poor choice and just tossed in when reviewing the license to get out of Sun's namespace. There is nothing in the rxtx license limiting your freedom in this fashion though. Many companies are moving to gnu.io and some distribute it with popular applications you would recognize. I'm tempted to ask you not to contaminate rxtx 2.1 with the javax.comm namespace. You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) extensions to existing classes (which I dont think you are using); it is not just javax.comm. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 24 13:24:09 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 20:24:09 +0100 (BST) Subject: [Rxtx] parity missed In-Reply-To: <42BBD9ED.3060004@emation.pt> References: <42BBD9ED.3060004@emation.pt> Message-ID: On Fri, 24 Jun 2005, Ricardo Trindade wrote: > Hi, > > I have a "parity missed error". From previous posts I believe this > has to do with CMSPAR not being defined. > I checked out 2.1 head from CVS. How can I make sure I do a proper > build and CMSPAR is defined ? Perhaps it would be good to have a release > snapshot that has this, I think the latest snapshot > (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. > > Another question I have, is why must this depend on kernel headers, > why can't it be defined in the RXTX source ? > I used to cheat and grab the CMSPAR from the kernel headers because glibc did not have it. Now rxtx uses the glibc headers and we have a patch in glibc I trust that handles this. It would not be right to override glibc and it wasnt right to use the kernel headers (it really did cause problems). You can override glibc for now with the following in the top of SerialImp.c # define CMSPAR 010000000000 You can check if your distro headers have this right bit looking for the above in bits/termios.h. It should look like this: #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif If it is not defined, please file a bug with your distro as rxtx is not the only thing that will be broken on that distro. I was going to release new cvs snapshots last weekend but got tied up. I'll do it this weekend. I also need to get custom baudrate patches into the cvs snapshot. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Fri Jun 24 13:56:50 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 20:56:50 +0100 Subject: [Rxtx] parity missed In-Reply-To: References: <42BBD9ED.3060004@emation.pt> Message-ID: <42BC6582.2070805@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050624/e3b39631/attachment-0397.html From vlado.handziski at gmail.com Sat Jun 25 06:25:52 2005 From: vlado.handziski at gmail.com (Vlado Handziski) Date: Sat, 25 Jun 2005 14:25:52 +0200 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: <697986ec05062505256ebf381f@mail.gmail.com> Thanks for the clarification. Since changing the bundled source is not an option at this moment, we will consider using javax.comm and RXTX2.0. In the next rewrite, we would probably move to gnu.io . Best regards, Vlado Handziski On 6/24/05, Trent Jarvi wrote: > > On Fri, 24 Jun 2005, Vlado Handziski wrote: > > > Hi all, > > > > let me first express my compliments on the great work you have done with > > the RXTX library. > > > > We have been using the library for some time, and we are at a point > where > > we want to make our code public. For legacy reasons, the code that the > > RXTX library is bundled with, uses the javax.comm namespace. We have > been > > using the ChangePackage script to change the RXTX2.1 package from gnu.io > > into javax.comm. We need the independent implementation since we want to > > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > > versions are just not as stable. > > > > On the download page, there is a comment that this is in violation of > > sun's license. Can someone shed more light on this. I was not aware that > > you can protect the names of the java packages. > > > > Best regards, > > Vlado > > > > I can't provide legal advice as I am not a lawyer. > > (v) may not create, or authorize your licensees to create additional > classes, interfaces, or subpackages that are contained in the "java", > "javax" or "sun" packages or similar as specified by Sun in any class file > naming convention; and > > The license is in the commapi package from Sun. The above is also in all > the EULA's you click through to download from Sun if I'm not mistaken. > > Simply put, the license taints developers that agree to it. For those > developers, Sun has control of the javax.comm namespace. > > It really does not make sense to put rxtx 2.1 in the javax.comm namespace. > It will only cause confusion which I think is the point of the clause > above. The gnu.io namespace was perhaps a poor choice and > just tossed in > when reviewing the license to get out of Sun's namespace. > > There is nothing in the rxtx license limiting your freedom in this fashion > though. Many companies are moving to gnu.io and some > distribute it with > popular applications you would recognize. I'm tempted to ask you not > to contaminate rxtx 2.1 with the javax.comm namespace. > > You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm > using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) > extensions to existing classes (which I dont think you are using); it is > not just javax.comm. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050625/1dadc50e/attachment-0397.html From taj at www.linux.org.uk Sun Jun 26 11:34:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 26 Jun 2005 18:34:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. Message-ID: The attached file should fix baud_base and divisor extensions for Linux The patch is against rxtx 2.1 CVS HEAD. To use this patch, you should set the baud rate to 38400. You can then try SerialPort.setBaudBase(int) and SerialPort.setDivisor(int) There are matching int SerialPort.getBaudBase() and int SerialPort.getDivisor(). What baud bases are available depends upon the serial port card and its driver so this is a bit of a blind attempt on my part. I've looked at the w32 API and I dont see anything available yet. The w32 code in RXTX will probably be figuring out the baud rate based on the tried baud base and divisor and just slamming it at the API for now (the API does something with that but I've not found real documentation on what it does). I dont want to try tinkering with the UART directly yet as that would involve poking machine memory directly and could very easily be error prone in bad ways. I don't expect Solaris or any SysV UNIX systems to work at all with this - ever. It is not standard in any way and will throw Exceptions on everything but Linux (w32 will just fail miserably as it is 1/2 implemented). If anyone has looked at custom baud rates before and has some thoughts or just wants to try the attached untested patch, I'd appreciate any feedback. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- ? autom4te.cache ? build ? output cvs server: Diffing . Index: configure =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure,v retrieving revision 1.35.2.59 diff -u -r1.35.2.59 configure --- configure 16 Oct 2004 16:20:34 -0000 1.35.2.59 +++ configure 26 Jun 2005 16:59:28 -0000 @@ -9644,6 +9644,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { #if defined (__GLIBC__) @@ -9782,6 +9784,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { @@ -9825,7 +9829,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -9837,7 +9841,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 26 Jun 2005 16:59:28 -0000 @@ -218,6 +218,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { #if defined (__GLIBC__) @@ -356,6 +358,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { @@ -399,7 +403,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -411,7 +415,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" cvs server: Diffing CNI cvs server: Diffing MACOSX_IDE cvs server: Diffing MACOSX_IDE/CW cvs server: Diffing MACOSX_IDE/ForPackageMaker cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions cvs server: Diffing MACOSX_IDE/ForPackageMaker/Resources cvs server: Diffing MACOSX_IDE/PB cvs server: Diffing WinCE cvs server: Diffing contrib cvs server: Diffing debian cvs server: Diffing src Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 26 Jun 2005 16:59:29 -0000 @@ -2079,15 +2079,17 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int BaudBase The clock frequency divided by 16. Default * BaudBase is 115200. * @return boolean true on success - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:setBaudBase()"); @@ -2097,10 +2099,11 @@ /** * Extension to CommAPI * @return int BaudBase - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getBaudBase() throws UnsupportedCommOperationException + public int getBaudBase() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getBaudBase()"); @@ -2108,13 +2111,14 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, IOException { if ( debug ) z.reportln( "RXTXPort:setDivisor()"); @@ -2124,10 +2128,11 @@ /** * Extension to CommAPI * @returns int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getDivisor() throws UnsupportedCommOperationException + public int getDivisor() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getDivisor()"); Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 26 Jun 2005 16:59:30 -0000 @@ -1877,16 +1877,27 @@ int fd = get_java_var( env, jobj,"fd","I" ); struct serial_struct sstruct; + if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) + { + goto fail; + } + + sstruct.baud_base = (int) BaudBase; + if ( sstruct.baud_base < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetBaudBase", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetBaudBase", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1914,9 +1925,13 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) ( sstruct.baud_base ) ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetBaudBase", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetBaudBase", strerror( errno ) ); @@ -1950,19 +1965,23 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } if ( sstruct.custom_divisor < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetDivisor", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetDivisor", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1971,7 +1990,7 @@ accept: none perform: Find the Divisor used for custom speeds - return: Divisor + return: Divisor negative value on error. exceptions: Unsupported Comm Operation on systems not supporting TIOCGSERIAL comments: @@ -1990,10 +2009,14 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) sstruct.custom_divisor ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetDivisor", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetDivisor", strerror( errno ) ); @@ -2032,7 +2055,7 @@ /* Open and lock the port so nothing else changes the setting */ - if ( LOCK( filename, pid ) ) goto fail;; + if ( LOCK( filename, pid ) ) goto fail; fd = find_preopened_ports( filename ); if( !fd ) Index: src/SerialPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/Attic/SerialPort.java,v retrieving revision 1.3.2.9 diff -u -r1.3.2.9 SerialPort.java --- src/SerialPort.java 12 Oct 2004 08:59:28 -0000 1.3.2.9 +++ src/SerialPort.java 26 Jun 2005 16:59:30 -0000 @@ -103,13 +103,17 @@ public abstract String getUARTType() throws UnsupportedCommOperationException; public abstract boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getBaudBase() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getDivisor() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setLowLatency() throws UnsupportedCommOperationException; public abstract boolean getLowLatency() cvs server: Diffing src/lfd cvs server: Diffing src/psmisc From uwe at kubosch.no Mon Jun 27 14:13:57 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Mon, 27 Jun 2005 22:13:57 +0200 Subject: [Rxtx] RXTX on FC4 Message-ID: <1119903238.2989.27.camel@BPC0276> Hi all! I just got RXTX to work on Fedora Core 4. The standard download did not work. I had to check the code out from CVS and build it, but then it worked flawlessly. Thanks for your good work. Now I wonder if I should contribute the compiled files so that others will have an easier time than me getting RXTX to work on FC4. What do I do? Who do I talk to? donV From taj at www.linux.org.uk Mon Jun 27 14:29:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 27 Jun 2005 21:29:46 +0100 (BST) Subject: [Rxtx] RXTX on FC4 In-Reply-To: <1119903238.2989.27.camel@BPC0276> References: <1119903238.2989.27.camel@BPC0276> Message-ID: On Mon, 27 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I just got RXTX to work on Fedora Core 4. > > The standard download did not work. > > I had to check the code out from CVS and build it, but then it worked > flawlessly. > > Thanks for your good work. > > Now I wonder if I should contribute the compiled files so that others > will have an easier time than me getting RXTX to work on FC4. What do I > do? Who do I talk to? > > The best thing to do with FC is to contibute an extras RPM. Debian does something like this with their .deb packaging. As rxtx is OS neutral, it is almost impossible to have everything on rxtx.org. If you do get a package in Fedora Extras, I can point a link there. The extra's mail list is here: https://www.redhat.com/mailman/listinfo/fedora-extras-list If it would help to have me release a 'stable' .tar.gz of the source for the RPM submittal process I can do that. It would also trigger upgrades in debian which would not be bad. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Mon Jun 27 16:23:20 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 27 Jun 2005 17:23:20 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: Message-ID: <42C07C58.1030608@atcorp.com> Hey Trent, I installed it and now I get IOExceptions instead of the other one. I'm not sure how those changes would have enabled setDivisor and setBaudBase to work though. Is it significant that this is a USB device emulating a serial port? ~ Shawn From taj at www.linux.org.uk Mon Jun 27 18:07:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 01:07:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: <42C07C58.1030608@atcorp.com> References: <42C07C58.1030608@atcorp.com> Message-ID: On Mon, 27 Jun 2005, Shawn Lavelle wrote: > Hey Trent, > I installed it and now I get IOExceptions instead of the other one. > I'm not sure how those changes would have enabled setDivisor and > setBaudBase to work though. Is it significant that this is a USB device > emulating a serial port? > The USB driver probably does not support this. With USB, the ioctl()'s appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through the linux drivers/usb tree and found to ioctl to support this in Linux 2.6.10. RXTX is not doing very much magic, the patch really only gets the serial struct instead of writing a structure with random values for baudbase and handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel level driver issue not a user space library issue. So if you wanted this to work, the usb serial driver would have to handle the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression after looking through the USB tree quickly. I hope that helps. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Jun 27 18:25:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 27 Jun 2005 20:25:22 -0400 Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) Message-ID: Hi All, I wrote: Jasmine: Is this working any better? And Jasmine says: Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) I am using -source 1.3 and -target 1.3 for the compilation, however, we still seem to have this problem, which my machine (for some reason) does not have. Does anyone have any ideas about what might be the problem? Thanks! - DL From taj at www.linux.org.uk Mon Jun 27 19:04:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 02:04:37 +0100 (BST) Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) In-Reply-To: References: Message-ID: On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I wrote: > Jasmine: Is this working any better? > > And Jasmine says: > Nope. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > > I am using -source 1.3 and -target 1.3 > for the compilation, however, we still seem to have this problem, > which my machine (for some reason) does not have. > Does anyone have any ideas about what might be the problem? > This has shown up in the past with jdk 1.5 compiled jars running on jre 1.4 machines. My guess is either jasmine has an old copy of rxtx with the problem on her machine that is being picked up on the classpath or you have not tried this with jre 1.4. The suggested -source/target fix should avoid the problem. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Mon Jun 27 21:23:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 04:23:55 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: On Tue, 28 Jun 2005, Trent Jarvi wrote: > On Mon, 27 Jun 2005, Shawn Lavelle wrote: > > > Hey Trent, > > I installed it and now I get IOExceptions instead of the other one. > > I'm not sure how those changes would have enabled setDivisor and > > setBaudBase to work though. Is it significant that this is a USB device > > emulating a serial port? > > > > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > > RXTX is not doing very much magic, the patch really only gets the serial > struct instead of writing a structure with random values for baudbase and > handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel > level driver issue not a user space library issue. > > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. > > I hope that helps. > > > It may be possible that you can just modify translate_speed and get_java_baudrate in SerialImp.c to have the new high speds you are after. The defines are in /usr/include/termios.h. #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 You can see many of these are not handled. I dont think CommAPI handled more than 57600 or so. int get_java_baudrate( int native_speed ) { switch( native_speed ) { case B0: return 0; case B50: return 50; case B75: return 75; case B110: return 110; case B134: return 134; case B150: return 150; case B200: return 200; case B300: return 300; case B600: return 600; case B1200: return 1200; case B1800: return 1800; case B2400: return 2400; case B4800: return 4800; case B9600: return 9600; case B19200: return 19200; case B38400: return 38400; case B57600: return 57600; default: return -1; } } int translate_speed( JNIEnv *env, jint speed ) { LEAVE( "RXTXPort:translate_speed" ); switch( speed ) { case 0: return B0; case 50: return B50; case 75: return B75; case 110: return B110; case 134: return B134; case 150: return B150; case 200: return B200; case 300: return B300; case 600: return B600; case 1200: return B1200; case 1800: return B1800; case 2400: return B2400; case 4800: return B4800; case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; #ifdef B57600 case 57600: return B57600; #endif /* B57600 */ #ifdef B115200 case 115200: return B115200; #endif /* B115200 */ #ifdef B230400 case 230400: return B230400; #endif /* B230400 */ #ifdef B460800 case 460800: return B460800; #endif /* B460800 */ #ifdef B14400 case 14400: return B14400; #endif /* B14400 */ #ifdef B28800 case 28800: return B28800; #endif /* B28800 */ #ifdef B128000 /* dima */ case 128000: return B128000; #endif /* dima */ #ifdef B256000 /* dima */ case 256000: return B256000; #endif /* dima */ } /* Handle custom speeds */ if( speed >= 0 ) return speed; else { LEAVE( "RXTXPort:translate_speed: Error condition" ); return -1; } } -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 28 05:20:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 28 Jun 2005 07:20:21 -0400 Subject: [Rxtx] cross-compilation using Make for Mac Message-ID: Hi All, Please excuse the long post; Trent said: >" >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. " Here is what I have on the mac version: java -version java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) When I run: http://show.docjava.com:8086/book/cgij/code/jnlp/math.benchmarks.Dhry.jnlp I get: -- listing properties -- jnlpx.heapsize=NULL,NULL jnlpx.splashport=-1 java.runtime.name=Java(TM) 2 Runtime Environment, Stand... java.protocol.handler.pkgs=com.sun.javaws.net.protocol sun.boot.library.path=/System/Library/Frameworks/JavaVM.fra... java.vm.version=1.4.2-38 awt.nativeDoubleBuffering=true gopherProxySet=false http.auth.serializeRequests=true java.vm.vendor="Apple Computer, Inc." java.vendor.url=http://apple.com/ path.separator=: java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io jnlpx.home=/Applications/Utilities/Java/Java Web... user.country=US sun.os.patch.level=unknown java.vm.specification.name=Java Virtual Machine Specification user.dir=/ java.runtime.version=1.4.2_05-141.4 java.awt.graphicsenv=apple.awt.CGraphicsEnvironment java.endorsed.dirs=/System/Library/Frameworks/JavaVM.fra... os.arch=ppc java.io.tmpdir=/tmp line.separator= java.vm.specification.vendor=Sun Microsystems Inc. jnlpx.remove=false os.name=Mac OS X sun.java2d.fontpath= java.library.path=/Applications/Utilities/Java/Java Web... java.specification.name=Java Platform API Specification java.class.version=48.0 jnlpx.deployment.user.home=/Users/lyon/Library/Caches/Java Web S... java.util.prefs.PreferencesFactory=java.util.prefs.MacOSXPreferencesFactory os.version=10.3.9 user.home=/Users/lyon user.timezone=America/New_York java.security.policy=file:/Applications/Utilities/Java/Jav... java.awt.printerjob=apple.awt.CPrinterJob trustProxy=true java.specification.version=1.4 file.encoding=MacRoman jnlpx.deployment.system.home=/Applications/Utilities/Java/J2SE 5.0... user.name=lyon java.class.path=/Applications/Utilities/Java/Java Web... java.vm.specification.version=1.0 sun.arch.data.model=32 java.home=/System/Library/Frameworks/JavaVM.fra... java.specification.vendor=Sun Microsystems Inc. user.language=en awt.toolkit=apple.awt.CToolkit java.vm.info=mixed mode java.version=1.4.2_05 java.ext.dirs=/Users/lyon/Library/Java/Extensions:/... sun.boot.class.path=/System/Library/Frameworks/JavaVM.fra... java.vendor=Apple Computer, Inc. file.separator=/ java.vendor.url.bug=http://developer.apple.com/java/ sun.cpu.endian=big sun.io.unicode.encoding=UnicodeBig mrj.version=141.3 jnlpx.jvm=/System/Library/Frameworks/JavaVM.fra... sun.cpu.isalist= sun.awt.exception.handler=apple.awt.CToolkit$EventQueueExceptio... javawebstart.version=javaws-1.4.2_05 800 mhz g4,878k ds/sec total time: 1184ms Result: 844594 dhrystone/sec. Load average for last 15 minutes:0.62 So, I feel pretty sure that I have tried this with 1.4. As to modifying the RXTX compilation, that I did not do...and I take your point. I have been using the binary distributions as is. Oops. I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Now when I do a make, I get: make gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known libtool: link: warning: undefined symbols not allowed in i386-pc-mingw32 shared libraries rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ln: `SerialImp.o': File exists make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 So, I do a make clean, then a make: .... (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ar cru .libs/librxtxSerial.a /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o ar: /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o: No such file or directory make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 In the i386 directory, there is a symbolic link left from something: ls -al SerialImp.o lrwxrwxrwx 1 lyon lyon 12 Jun 28 07:03 SerialImp.o -> SerialImp.lo However, the SerialImp.lo is not present (which is the cause of the error, I think). On the other hand, the file I am looking for is present in: i686-pc-linux-gnu Possibly the i386 generation is not clean (of course it is also likely that I am just asking dumb questions, being a newbie to the code and all.). Finally, will this make file regenerate the distro for the mac? I found some really old (from year 2001) files in: cvs/MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions Which I could use for the distro...but I would prefer to do a clean, multi-platform build from make. Thanks! - Doug >On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > >> Hi All, >> I wrote: >> Jasmine: Is this working any better? >> >> And Jasmine says: >> Nope. >> >> An error occurred while launching/running the application. >> >> Title: addbk.JAddressBook.Main >> Vendor: DocJava, Inc. >> Category: Unexpected Error >> >> gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) >> >> > > I am using -source 1.3 and -target 1.3 >> for the compilation, however, we still seem to have this problem, >> which my machine (for some reason) does not have. >> Does anyone have any ideas about what might be the problem? >> > >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. > > >The suggested -source/target fix should avoid the problem. > >-- >Trent Jarvi >tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 28 09:43:41 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 28 Jun 2005 10:43:41 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: <42C1702D.1070307@atcorp.com> > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. There is ioctl stuff in the driver for the chip, but i haven't seen the TIOC*SERIAL entries. That might be why it continues to fail. I did get around the problem, though, by hacking the driver and just specifying the baud rate I need. Now everything works well. Thanks for all the assistance you've provided. ~ Shawn M. Lavelle From taj at www.linux.org.uk Tue Jun 28 12:42:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:42:29 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known Add a compiler flag -DWIN32 The code above should not be compiling on w32 as it is #if !defined(WIN32) You can look at the bottom of Makefile.in to see the w32 compile flags. Search for "WIN32 CrossCompiling from here down" If its still not working, I can set you up with the Bob account. Just email me off the list. W32 compiling is a bit complicated. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 28 12:52:50 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:52:50 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Nods. I did change configure but right now it is only in the baudbase/divisor patch I posted. I'm going to add several extension baud rates that can be supported by normal API calls and commit that today as a followup to my comments yesterday on baudrates. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Wed Jun 29 01:52:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 08:52:10 +0100 (BST) Subject: [Rxtx] [PATCH] More baud rate fixes Message-ID: I went through the native baudrate conversion from Java and added several. This patch is against CVS 2.1 head. I think thats it for baud rate fixes unless someone see something. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- A non-text attachment was scrubbed... Name: baud_base_and_divisor_plus_odd_baudrates.diff.gz Type: application/x-gzip Size: 3291 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050629/4c1ef1c2/baud_base_and_divisor_plus_odd_baudrates.diff-0397.gz From lyon at docjava.com Wed Jun 29 10:33:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 29 Jun 2005 12:33:45 -0400 Subject: [Rxtx] java.comm dependencies Message-ID: Hi All, During a build of the rxtx code, I have left the javax.comm out of the system (on purpose). However, I get an error, at run time: CommPortIdentifier:static initialization() apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: javax/comm/CommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver I am thinking that there is something in the gnu.io.CommPortIdentifier that seeks to load the javax.comm.CommDriver. It was my understanding that we could write code without reference to the javax.comm.CommDriver and that we could work in the gnu namespace. Is this true? Thanks! - Doug From taj at www.linux.org.uk Wed Jun 29 11:16:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 18:16:08 +0100 (BST) Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > During a build of the rxtx code, I have left the > javax.comm out of the system (on purpose). > However, I get an error, at run time: > > CommPortIdentifier:static initialization() > apple.awt.EventQueueExceptionHandler Caught Throwable : > java.lang.NoClassDefFoundError: javax/comm/CommDriver > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > that seeks to load the javax.comm.CommDriver. > > It was my understanding that we could write code without reference > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > Is this true? > Yes. People use 2.1 without javax all the time. There should be no reference to javax at all in rxtx 2.1. You may check your code. I just did a grep through 2.1 and there is nothing. You may look at the classes you are using. If you find javax.comm in your code, replace it with gnu.io and that should be all you need to do. -- Trent Jarvi tjarvi at qbang.org From jayant28k at gmail.com Wed Jun 29 21:49:28 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Thu, 30 Jun 2005 09:19:28 +0530 Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: <6a6a02310506292049778c452f@mail.gmail.com> Trent, I think best idea is to have wiki for rxtx code. So as the traffic is increasing with time. "RXTX" seems to be more popular in embbeded system. Sun Microsystems will always apperciate your efforts on parallel and serial ports commincation based application in IT Industry. Thanks for your help on this forum as "ONE MAN ARMY" ;-) Cheers, Jayant On 6/29/05, Trent Jarvi wrote: > On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > > > Hi All, > > During a build of the rxtx code, I have left the > > javax.comm out of the system (on purpose). > > However, I get an error, at run time: > > > > CommPortIdentifier:static initialization() > > apple.awt.EventQueueExceptionHandler Caught Throwable : > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > > that seeks to load the javax.comm.CommDriver. > > > > It was my understanding that we could write code without reference > > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > > > Is this true? > > > > Yes. People use 2.1 without javax all the time. > > There should be no reference to javax at all in rxtx 2.1. You may check > your code. I just did a grep through 2.1 and there is nothing. You may > look at the classes you are using. > > If you find javax.comm in your code, replace it with gnu.io and that > should be all you need to do. > > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From uwe at kubosch.no Sat Jun 25 02:50:24 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Sat, 25 Jun 2005 10:50:24 +0200 Subject: [Rxtx] RXTX in FC3/FC4 Message-ID: <1119689424.12606.14.camel@BPC0276> Hi all! I am trying to get RXTX to work on Fedora Core, version 3 or 4. I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext directory. I have edited the jre/lib/javax.comm.properties according to the docs. I have tried this with both rxtx 2.0 and 2.1. I have tried on two different machines. I have tried with java 1.4.2 and java 1.5.0, both from Sun. I always get a signall 11 from the native libraries when they are loaded. Is this a common problem? Any help is greatly appreciated. Below is the start of the error message. More can be supplied on demand. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x65015A Function=(null)+0x65015A Library=/lib/ld-linux.so.2 NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) - locked <0xed46f628> (a java.util.Vector) - locked <0xed471708> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xed46ebc0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.InitializeDriver(CommPortIdentifier.java:213) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:248) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:351) at com.jpeterson.x10.module.CM11A.allocate(CM11A.java:1160) at net.sourceforge.cruisecontrol.publishers.X10Publisher.send(X10Publisher.java:182) at net.sourceforge.cruisecontrol.publishers.X10Publisher.turnOff(X10Publisher.java:171) at net.sourceforge.cruisecontrol.publishers.X10Publisher.handleBuild(X10Publisher.java:148) at net.sourceforge.cruisecontrol.publishers.X10Publisher.publish(X10Publisher.java:141) at net.sourceforge.cruisecontrol.Project.publish(Project.java:679) at net.sourceforge.cruisecontrol.Project.build(Project.java:227) at net.sourceforge.cruisecontrol.Project.execute(Project.java:153) at net.sourceforge.cruisecontrol.ProjectWrapper.run(ProjectWrapper.java:66) at java.lang.Thread.run(Thread.java:534) From chris_jh at blueyonder.co.uk Tue Jun 28 05:37:10 2005 From: chris_jh at blueyonder.co.uk (Christopher Harris) Date: Tue, 28 Jun 2005 12:37:10 +0100 Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError Message-ID: <42C13666.9030108@blueyonder.co.uk> Hi I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 32bit) The serial ports work fine with no issues, but when i try to use the parallel port i get this message Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:66) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) I am trying to print a line out to port "/dev/lp0" At first i thought it could not find the librxtxParallel.so file, but when i renamed it i got a different saying it could not find the library. I have tried to run as root no difference. It is really weird, i get no compile errors and the serial ports work fine. I changed the LPRPort.java and commented out the Initialize call method. And just get the same error but for the method open. It is as though it can't see the methods, and yet it can see the library. I did have a bit of check of the JNI implementation in rxtx but could not spot anything. Yours Thankfully Christopher Harris From lyon at docjava.com Thu Jun 30 02:28:09 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 04:28:09 -0400 Subject: [Rxtx] tools Message-ID: Hi All, I have been thinking about automatic cross-platform native method development of Java/C programs. It appears that different binary tools are needed to target different platforms. Configuration seems a bit painful. Is there something better available than make? Is ANT any good at this? Has anyone tried: http://jnipp.sourceforge.net/ Thanks! - Doug From lyon at docjava.com Thu Jun 30 04:11:17 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 06:11:17 -0400 Subject: [Rxtx] javax.comm Message-ID: Hi All, When I load my jar files on a linux box, all is well. However, when I load them on a mac, I get: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver The jar files for the mac are different from the jar files for linux, because recompilation of the native code for the mac has not been easy, for me. As a result, the RXTX jars are tending toward specific versions and platforms. Probably, this is not an ideal situation, but, I suspect, it is common. I have an idea that we could create a single JNLP distro site that we can make reference to that would enable a uniform repository of synchronized signed native methods and jars for RXTX. For example, the one-wire Maxim folks have a real-nice approach where their stuff makes reference to another JNLP file that contains all the stuff we need to make RXTX work. Check it out at: http://www.maxim-ic.com/products/ibutton/software/1wire/OneWireViewer.cfm However, even they have problems on an unconfigured machine: Specified adapter name "DS9097U" is not known * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cannot load default adapter. Please check that the adapter is connected and that no other application is using the port. If you have checked the adapter, the default port might not be selected. Either set the value of the TMEX default using the utility provided with the TMEX Runtime, or create a new file in the /lib folder called onewireviewer.properties with two lines, similar to the following: #native win32 drivers adapter.name={DS9097U} adapter.port=COM1 #or javax.comm drivers adapter.name=DS9097U adapter.port=COM1 The full path to this file should be: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/onewireviewer.properties ---- Wow, that is a show stopper! Configuration is something that we really need to think about as an automatic thing, particularly for web start users. You can't ask a person who wants to run an application to figure out how to alter a properties file. If you know you need one, then get permission and make one...automatically. That makes a lot of sense, to me. Basically, we need an installer. At the very least, all the pre-built binaries and jars needed for the RXTX package on several platforms should be available from a single place. One this happens, we can make a JNLP file that is platform specific, but can give us a level of indirection. Is this something that has been done already? Thanks! - Doug From taj at www.linux.org.uk Thu Jun 30 08:10:22 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 15:10:22 +0100 (BST) Subject: [Rxtx] tools In-Reply-To: References: Message-ID: On Thu, 30 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I have been thinking about automatic cross-platform > native method development of Java/C programs. > > It appears that different binary tools are needed to target different > platforms. Configuration seems a bit painful. > > Is there something better available than make? > > Is ANT any good at this? I'm far from an Ant expert but have used it for other projects. The main problem I see with ant is there is no mainstream support for platform neutral neutral library creation as far as I can tell. I think ant is a fine replacement for make but I've not seen a suitable replacement for autoconf. At that point, make is as good as anything. It should be possible to create a ant build.xml that works on say Solaris, Linux, Windows and Mac OS X. The problem is when you are trying to build a library for embeded ARM from Mac OS X. > Has anyone tried: > http://jnipp.sourceforge.net/ -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:22:02 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:22:02 +0100 (BST) Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <1119689424.12606.14.camel@BPC0276> References: <1119689424.12606.14.camel@BPC0276> Message-ID: On Sat, 25 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I am trying to get RXTX to work on Fedora Core, version 3 or 4. > > I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 > directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext > directory. > > I have edited the jre/lib/javax.comm.properties according to the docs. > > I have tried this with both rxtx 2.0 and 2.1. > > I have tried on two different machines. > > I have tried with java 1.4.2 and java 1.5.0, both from Sun. > > I always get a signall 11 from the native libraries when they are > loaded. Is this a common problem? Any help is greatly appreciated. > Below is the start of the error message. More can be supplied on > demand. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x65015A > Function=(null)+0x65015A > Library=/lib/ld-linux.so.2 > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) If you compile rxtx from source, this will probably go away. I'm not sure what the exact cause is but it looks like the binaries are not suitable for FC3/4. The ABI may have changed since those had been compiled. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:26:56 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:26:56 +0100 (BST) Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError In-Reply-To: <42C13666.9030108@blueyonder.co.uk> References: <42C13666.9030108@blueyonder.co.uk> Message-ID: tOn Tue, 28 Jun 2005, Christopher Harris wrote: > Hi > > I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 > 32bit) > > The serial ports work fine with no issues, but when i try to use the > parallel port i get this message > > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:66) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) > > > I am trying to print a line out to port "/dev/lp0" > > At first i thought it could not find the librxtxParallel.so file, but > when i renamed it i got a different saying it could not find the library. > > I have tried to run as root no difference. > > It is really weird, i get no compile errors and the serial ports work fine. > > I changed the LPRPort.java and commented out the Initialize call method. > And just get the same error but for the method open. > > It is as though it can't see the methods, and yet it can see the library. > I did have a bit of check of the JNI implementation in rxtx but could > not spot anything. > > > You can check if the symbols are in the shared library: nm librxtxSerial.so |grep Initialize If the symbols are not there, there was a build error. Watch very close for build errors while compiling from source. I suspect something isnt behaving right. -- Trent Jarvi tjarvi at qbang.org From allen at adbyrne.us Thu Jun 30 06:55:58 2005 From: allen at adbyrne.us (Allen Byrne) Date: Thu, 30 Jun 2005 07:55:58 -0500 Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> References: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> Message-ID: <200506300755.59159.allen@adbyrne.us> On Thursday 30 June 2005 00:31, rxtx-request at mail.electronpusher.org wrote: > >Message: 8 >Date: Sat, 25 Jun 2005 10:50:24 +0200 >From: Uwe Kubosch >Subject: [Rxtx] RXTX in FC3/FC4 >To: rxtx at mail.electronpusher.org >Message-ID: <1119689424.12606.14.camel at BPC0276> >Content-Type: text/plain > >Hi all! > >I am trying to get RXTX to work on Fedora Core, version 3 or 4. > >I have tried this with both rxtx 2.0 and 2.1. > >I have tried on two different machines. > >I have tried with java 1.4.2 and java 1.5.0, both from Sun. > >I always get a signall 11 from the native libraries when they are >loaded. ?Is this a common problem? ?Any help is greatly appreciated. >Below is the start of the error message. ?More can be supplied on >demand. > >An unexpected exception has been detected in native code outside the VM. >Unexpected Signal : 11 occurred at PC=0x65015A >Function=(null)+0x65015A >Library=/lib/ld-linux.so.2 > I had thi same problem on SUSE9.3 and java 1.5.0. After searching through the archives, I found a patch that required adding a sleep(1000) command in two functions of SerialIO.java. This only was for rxtx2.1, I had no trouble with rxtx2.0. Note, also I had to add the "|1.5*" sequence to the configure.in file to get good *.so libs. Again 2.0 was fine. -- Allen Byrne adbyrne at ieee.org http://modelrr.adbyrne.us From taj at www.linux.org.uk Fri Jun 3 01:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 08:57:29 +0100 (BST) Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 3 09:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 16:57:53 +0100 (BST) Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi at qbang.org From jasmine at electronpusher.org Fri Jun 3 10:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 17:12:21 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 11:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:02:09 +0100 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 11:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:05:10 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From jon.nall at gmail.com Mon Jun 6 09:13:58 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 10:13:58 -0500 Subject: [Rxtx] StackOverflowError Message-ID: I have a fairly small application that is communicating to a microcontroller programmer at 115.2k. I have a test where I try and dump the memory of the microcontroller (whose size is 8k and change). Things are going smoothly and the data looks good. Then after reading out ~6.5k of data, I get a StackOverflowError. The stack trace looks like: CommInterface.serialEvent(): 324 // this is my code RXTXPort.sendEvent(): 732 RXTXPort.eventLoop() [Native] MonitorThread.run(): 1531 I am running on windows and using rxtx-2.1-CVS-20050120. When I increased the stack size to 512k, I could read the entire chip without issue. But that doesn't seem like the right thing to do without root causing what's happening. My code doesn't include any recursion and the stack trace looks terribly short, so I'm a bit confused as to why I'm getting a StackOverflowError. CommInterface.serialEvent() does little more than grab the available bytes, enter a synchronized block, stick them in a common data area for the main thread to use and leave the synchronization block. I guess my question is: are there any known issues with the default stack size when using the latest rxtx on windows? thanks, nall. From taj at www.linux.org.uk Mon Jun 6 09:27:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 16:27:34 +0100 (BST) Subject: [Rxtx] StackOverflowError In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > I have a fairly small application that is communicating to a > microcontroller programmer at 115.2k. I have a test where I try and > dump the memory of the microcontroller (whose size is 8k and change). > Things are going smoothly and the data looks good. Then after reading > out ~6.5k of data, I get a StackOverflowError. The stack trace looks > like: > > CommInterface.serialEvent(): 324 // this is my code > RXTXPort.sendEvent(): 732 > RXTXPort.eventLoop() [Native] > MonitorThread.run(): 1531 > > I am running on windows and using rxtx-2.1-CVS-20050120. When I > increased the stack size to 512k, I could read the entire chip without > issue. But that doesn't seem like the right thing to do without root > causing what's happening. My code doesn't include any recursion and > the stack trace looks terribly short, so I'm a bit confused as to why > I'm getting a StackOverflowError. > > CommInterface.serialEvent() does little more than grab the available > bytes, enter a synchronized block, stick them in a common data area > for the main thread to use and leave the synchronization block. > > I guess my question is: are there any known issues with the default > stack size when using the latest rxtx on windows? > This is the first I've heard of the problem. It is strange as you mention lookin at the stack trace. That cant be taking up too much space. If you just toss the data instead of trying to put it in your work area, does it persist? -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Mon Jun 6 10:09:39 2005 From: lengyel at gmail.com (FL) Date: Mon, 6 Jun 2005 12:09:39 -0400 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on which the jdk1.5.0_03 is installed. I found that the INSTALL documentation seems to be in error. It states that javacomm20-x86.tar.Z (the Java Communications API for Solaris/x86) must be used, in fact this choice led to the following test with theBlackBox sample program in the commapi: root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG BlackBox -p /dev/ttyS0 Port /dev/ttyS0 not found! No serial ports found! Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to cause Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to the Eclipse stable build version 3.1M7 to avoid this. However, I found that using the Solaris/Sparc version of commapi worked on my system. I have documented this on: http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050606/b28fb9a7/attachment-0398.html From taj at www.linux.org.uk Mon Jun 6 10:30:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:30:27 +0100 (BST) Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, FL wrote: > I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on > which the jdk1.5.0_03 is installed. I found that the INSTALL documentation > seems to be in error. It states that javacomm20-x86.tar.Z (the Java > Communications API for Solaris/x86) must be used, in fact this choice led to > the following test with theBlackBox sample program in the commapi: > > root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG > BlackBox -p /dev/ttyS0 > Port /dev/ttyS0 not found! > No serial ports found! > > Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to > cause > Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to > the Eclipse stable build version 3.1M7 to avoid this. > > However, I found that using the Solaris/Sparc version of commapi > worked on my system. > > I have documented this on: > > http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 > Thanks FL. I'll change the documentation to point to the SPARC comm.jar. In the past, any Solaris was good enough, we tried to avoid the w32 comm.jar because it made native calls rxtx would never implement on any OS as they are not platform neutral. I'll withold comments about Sun's comm.jar being different on various CPUs within even the same OS. RXTX 2.1 does not need to do that even acrossed OSs for instance. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 6 10:35:43 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 11:35:43 -0500 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API Message-ID: It seems that Sun's javax.comm site does not include JavaDoc'ed API and the RxTx site has the API, but no real documentation. Is there some site that i'm just missing in my google searches? I'm looking for a copy of the javax.comm API which is documented. Thanks, nall. From taj at www.linux.org.uk Mon Jun 6 10:44:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:44:03 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > It seems that Sun's javax.comm site does not include JavaDoc'ed API > and the RxTx site has the API, but no real documentation. Is there > some site that i'm just missing in my google searches? I'm looking for > a copy of the javax.comm API which is documented. > > Thanks, > nall. Sun's version is with their binary downloads. RXTX tries to match that so I never bothered with more complete JavaDocs. Whatever Sun documents is what we try to do. -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Mon Jun 6 12:13:44 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 6 Jun 2005 14:13:44 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: Message-ID: <20050606181245.528C929D56F@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Trent Jarvi > Sent: Monday, June 06, 2005 12:44 PM > To: Jon Nall; Java RXTX discussion > Subject: Re: [Rxtx] Where can I find JavaDoc on the javax.comm API > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > It seems that Sun's javax.comm site does not include JavaDoc'ed API > > and the RxTx site has the API, but no real documentation. Is there > > some site that i'm just missing in my google searches? I'm > looking for > > a copy of the javax.comm API which is documented. > > > > Thanks, > > nall. > > Sun's version is with their binary downloads. RXTX tries to > match that so I never bothered with more complete JavaDocs. > Whatever Sun documents is what we try to do. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Try http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht ml -Ack From gadelavega at yahoo.com.ar Mon Jun 6 12:58:09 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Mon, 6 Jun 2005 15:58:09 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606181245.528C929D56F@mail.electronpusher.org> Message-ID: <20050606185809.57069.qmail@web14603.mail.yahoo.com> --- "David S. Acker" escribi?: > > -----Original Message----- > > From: rxtx-bounces at mail.electronpusher.org > > [mailto:rxtx-bounces at mail.electronpusher.org] On > Behalf Of Trent Jarvi > > Sent: Monday, June 06, 2005 12:44 PM > > To: Jon Nall; Java RXTX discussion > > Subject: Re: [Rxtx] Where can I find JavaDoc on > the javax.comm API > > > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > > > It seems that Sun's javax.comm site does not > include JavaDoc'ed API > > > and the RxTx site has the API, but no real > documentation. Is there > > > some site that i'm just missing in my google > searches? I'm > > looking for > > > a copy of the javax.comm API which is > documented. > > > > > > Thanks, > > > nall. > > > > Sun's version is with their binary downloads. > RXTX tries to > > match that so I never bothered with more complete > JavaDocs. > > Whatever Sun documents is what we try to do. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > Try > http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > ml > -Ack > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > I'm prety sure it was there... but not anymore. Gonzalo A. de la Vega, BI ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From taj at www.linux.org.uk Mon Jun 6 18:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 01:09:14 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606185809.57069.qmail@web14603.mail.yahoo.com> References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: >> http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > > I'm prety sure it was there... but not anymore. > It is there. Maybe the URL got mangled. Try this http://tinyurl.com/8dfp7 It just redirects you to: http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.html -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 7 05:46:39 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Jun 2005 07:46:39 -0400 Subject: [Rxtx] rxtx under fedora - odd procedures Message-ID: Hi All, I was able to get RXTX communications to work under Fedora, but only after I added myself to the UUCP and LOCK groups, logged out and then logged back in. Both groups appear to be needed in order to access the serial ports. Also the group alter did not take until after I logged out and logged back in. My theory is that you need permission to write to the var/spool directory under fedora and that this is the only way to do it. Logging out and logging back in just seems like an odd thing to do. I suppose some users may have to restart X. Ouch! Is this true? The alter_group command indicates that you need to be an su to alter the group database. Does this mean that my serial port users need a database su able person to use serial port applications under RXTX? If so, what is the procedure to make a transparent install work using Java web start? Should I be prompting users for the su password? Should I be telling users to exit from X and log out? Is this the way other serial communications programs work? Thanks! - Doug From sean_montgomery at baseview.com Tue Jun 7 08:14:51 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 7 Jun 2005 10:14:51 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: >>> http://java.sun.com/products/javacomm/javadocs/javax/comm/package- >>> summary.ht >>> > > >> >> I'm prety sure it was there... but not anymore. >> >> > > It is there. Maybe the URL got mangled. Try this > > http://tinyurl.com/8dfp7 > > It just redirects you to: > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > summary.html > Maybe the issue here is that the info is available without frames from that URL, but when you try to access it with frames (from the link on that page) it doesn't work - it takes you to: http://java.sun.com/products/javacomm/javadocs/index.html Which doesn't have anything useful on it. From gadelavega at yahoo.com.ar Tue Jun 7 08:22:50 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:22:50 -0300 (ART) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: Message-ID: <20050607142251.92850.qmail@web14626.mail.yahoo.com> --- "Dr. Douglas Lyon" escribi?: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the > group > alter did not take until after I logged out and > logged back in. > > My theory is that you need permission to write to > the var/spool > directory under fedora and that this is the only way > to do it. > > Logging out and logging back in just seems like an > odd thing to > do. I suppose some users may have to restart X. > Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port > applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log > out? > Is this the way other serial communications programs > work? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Actually, you need the lock group to acces /var/lock directory, and uucp to acces /dev/ttyS*. You (as root) shuold add all users you will allow to use the serial ports to group uucp and all the ones you'll allow to lock the ports to lock group (rxtx needs both). This is not only for rxtx, but for any use of the serial ports. Next time they login they'll be able to work, so if they are in they'll have to log out first. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From gadelavega at yahoo.com.ar Tue Jun 7 08:23:56 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:23:56 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> Message-ID: <20050607142356.93815.qmail@web14624.mail.yahoo.com> --- Sean Montgomery escribi?: > > On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: > > >>> > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > >>> summary.ht > >>> > > > > > >> > >> I'm prety sure it was there... but not anymore. > >> > >> > > > > It is there. Maybe the URL got mangled. Try this > > > > http://tinyurl.com/8dfp7 > > > > It just redirects you to: > > > > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > > summary.html > > > > Maybe the issue here is that the info is available > without frames > from that URL, but when you try to access it with > frames (from the > link on that page) it doesn't work - it takes you > to: > > http://java.sun.com/products/javacomm/javadocs/index.html > > Which doesn't have anything useful on it. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > That's right, my bad. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From jon.nall at gmail.com Tue Jun 7 08:33:40 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 09:33:40 -0500 Subject: [Rxtx] performance expectations Message-ID: Hi all. I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC microcontroller. The protocol I'm using (which I didn't create) looks like this for the section of code I'm concerned with: PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data PIC -> PC: 0x01 // ACK 0xNN // First 8 bits of data 0xMM // Second 8 bits of data I issue ~2000 of these Read commands. The PIC itself has an input fifo which can store 18 bytes, so I can have 18 read commands in flight at a given time. The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k 8N1. I am measuring the time it takes to perform these 2000 commands at around 30 seconds, which is much longer than I anticipated. With the link fully utilized, I expected: Time per byte transmitted: 115200 / 8 = 14400 bytes/second = ~70 uS/byte Time per response transmitted: ~70 uS/byte * 3 bytes/response = ~210 uS/response Time for 2000 responses to be transmitted: ~210 uS/response * 2000 responses = ~420ms I'm a bit new to this, so I may have made some bad asumptions, but I would have expected a time of a couple of seconds to perform the 2000 reads, not 30+ seconds. I'm obviously missing something here. Can someone help me understand what's going on? Thanks, nall. From taj at www.linux.org.uk Tue Jun 7 09:17:48 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:17:48 +0100 (BST) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the group > alter did not take until after I logged out and logged back in. > > My theory is that you need permission to write to the var/spool > directory under fedora and that this is the only way to do it. > > Logging out and logging back in just seems like an odd thing to > do. I suppose some users may have to restart X. Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log out? > Is this the way other serial communications programs work? > RIght now, rxtx requires you do one of two things. 1) Use lock files (recommended). This requires intervention by the root users to allow users to create lock files and open the ports as you note. 2) configure rxtx with --disable-lockfiles. In this case you need only worry about the permissions on /dev/ttyS* I'm not sure what the default on Fedora is with respect to permisions. This is not very attractive. There is a better way it could be done on Fedora. Fedora comes with lockdev library. I've been considering this for some time. We could use that for the locking and do away with many of the problems. The problem is embeded devices running Linux do not come with liblockdev. But for your use, I would consider adding a new option for locking serial devices using liblockdev. lockdev-devel has a man page with further information. SYNOPSIS #include pid_t dev_testlock( const char * devname); pid_t dev_lock( const char * devname); pid_t dev_relock( const char * devname, pid_t pid); pid_t dev_unlock( const char * devname, pid_t pid); cc [ flag ... ] file ... -llockdev [ library ] This would probably need to be a configure time option to prevent problems on embeded Linux devices but could otherwise be the default on Linux. I could toss a quick patch together if this is confusing. It is actually easier than what rxtx does now. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 09:27:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:27:11 +0100 (BST) Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > Hi all. > I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC > microcontroller. The protocol I'm using (which I didn't create) looks like this > for the section of code I'm concerned with: > > PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data > PIC -> PC: 0x01 // ACK > 0xNN // First 8 bits of data > 0xMM // Second 8 bits of data > > I issue ~2000 of these Read commands. The PIC itself has an input fifo which > can store 18 bytes, so I can have 18 read commands in flight at a given time. > The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k > 8N1. > > I am measuring the time it takes to perform these 2000 commands at around 30 > seconds, which is much longer than I anticipated. With the link fully utilized, > I expected: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte > > Time per response transmitted: > ~70 uS/byte * 3 bytes/response = ~210 uS/response > > Time for 2000 responses to be transmitted: > ~210 uS/response * 2000 responses = ~420ms > > I'm a bit new to this, so I may have made some bad asumptions, but I would have > expected a time of a couple of seconds to perform the 2000 reads, not 30+ > seconds. > > I'm obviously missing something here. Can someone help me understand what's > going on? > I've hooked rxtx in loopback with a scope in the past at 9600 baud (baud rate is not important). Using event notification and just writing a byte on event/read the latencey was around 8-12 ms. The JNI is not an efficient way to use native code - especially for bit banging. So if timing is critical you want to move some of the logic into the native code rather than banging over the JNI. 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your performance. C# has advantages here. If you move your logic into the native layer or use gcj (rxtx will work with that too) most of your latency should vanish. You may have to play with some sleeps in eventLoop at that point to get full native efficiency. With gcj all of rxtx becomes 'native code' as java is just treated as a subset of C++. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 09:38:51 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 10:38:51 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: On 6/7/05, Jon Nall wrote: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte of course that should be divided by 10 to account for the start/stop bits, but it barely changes the end results. From carobizar at free.fr Tue Jun 7 10:21:29 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 7 Jun 2005 18:21:29 +0200 Subject: [Rxtx] (no subject) Message-ID: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Hello ! I am a french student and I have to create an application able to read and write on serial and parallel port and to run on Windows and Linux. For the moment my program run on Windows thanks the Java Communication API (version for Microsoft Windows and Solaris/x86). But it doesn't work on Linux. Does a recent version of an installation documentation exist ? I didn't find one on the RXTX site (nothing for the windows installation and the linux installation deals with a "jcl.jar" that I don't know...). So, I have some questions : 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 version or Linux&w32 version ?) What are the differences between them ? Which of them are the most stable ? 2) Where have I to put the .so and .dll files ? 3) What have I to write on the file javax.comm.properties ? 4) Have I to delete the file win32comm.dll included in the Java Comm API ? 5) Have I to keep both comm.jar and RXTXcomm.jar ? Best regards, Caroline. From debief at telemsa.com Tue Jun 7 10:44:56 2005 From: debief at telemsa.com (DEBIEF Eric) Date: Tue, 7 Jun 2005 18:44:56 +0200 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: <200506071844.56656.debief@telemsa.com> Hi, We are "pushing" RxTx /Java here in a half-duplex link. The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC and application handling) about 25?s/byte. The figures are the barely the same on two environments. Environment 1 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Linux 2.6.3, Mdk 10.0. RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : bytes are lost on the wire. I need to investigate this mystery.... Java : 1.4.2-rc1 Blackdown Environment 2 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Windows 2000 Pro RxTx : 2.0.7. Java : 1.4.2_08 SUN I Hope this help, Eric. _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 7 11:05:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:05:45 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, DEBIEF Eric wrote: > Hi, > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. How many write() calls is this? > > Environment 1 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Linux 2.6.3, Mdk 10.0. > RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : > bytes are lost on the wire. I need to investigate this mystery.... > Java : 1.4.2-rc1 Blackdown > > Environment 2 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Windows 2000 Pro > RxTx : 2.0.7. > Java : 1.4.2_08 SUN > In my event/read/write test I found windows was ~20% faster than linux for some reason (strange part is Windows was in VMWare on the same Linux machine). It was about the same rxtx version. There are many problems with rxtx 1.4 with respect to commapi on windows but its code paths are more simple. What some people want from rxtx is perhaps better served by hacking up the very first release as they just want to read and write which is what rxtx was before Sun released commapi. It sounds like perhaps you are pushing out larger writes which will greatly improve results. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 11:16:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:16:49 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118161289.42a5c989cf6a2@imp4-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: On Tue, 7 Jun 2005 carobizar at free.fr wrote: > > Hello ! > > I am a french student and I have to create an application able to read and write > on serial and parallel port and to run on Windows and Linux. > For the moment my program run on Windows thanks the Java Communication API > (version for Microsoft Windows and Solaris/x86). > But it doesn't work on Linux. > > Does a recent version of an installation documentation exist ? > I didn't find one on the RXTX site (nothing for the windows installation and the > linux installation deals with a "jcl.jar" that I don't know...). > > So, I have some questions : > > 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 > version or Linux&w32 version ?) What are the differences between them ? Which > of them are the most stable ? > Use rxtx 2.0 with commapi for sparc solaris from Sun. If you want your current package javax.comm. > 2) Where have I to put the .so and .dll files ? On Linux just use the source, the configure script will do all of that for you. tar -xzvf rxtx-2.0-version mkdir rxtx-2.0-version/build cd rxtx-2.0-version/build ../configure && make install It will do everything for you. With Windows, you need to create the javax.comm.properties and install the DLL on your path. But you can just use Sun's package too. They are intended to be interchangable. > > 3) What have I to write on the file javax.comm.properties ? Driver=gnu.io.RXTXCommDriver More documentation in INSTALL that comes with the source. Sun's documentation should work too. configure does this for you on Linux. > > 4) Have I to delete the file win32comm.dll included in the Java Comm API ? > No > 5) Have I to keep both comm.jar and RXTXcomm.jar ? > Yes. RXTX 2.1 replaces comm.jar but the package is different (gnu.io) to avoid contaminating Sun's namespace. With rxtx 2.0 you need Sun's comm.jar - they work together. > > Best regards, > Caroline. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Tue Jun 7 12:07:34 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 14:07:34 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 Message-ID: <20050607180632.1543A29D5C8@mail.electronpusher.org> Hello, I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our product includes a built in USB to Serial adapter so that when it is connected to your PC over USB, it appears as a serial port. We had problems with Sun's comm library because it did not detect serial ports coming and going properly. I did run into a few issues with RxTx though. I am building under Windows (we support XP and 2000) under cygwin. I used a simple make file for the c code that works under cygwin and ant to build the java stuff. Attached is a diff file. The patches hit the following issues: ParallelImp.c - I am not using config so there is no config.h for me. Also, gcc didn't like a local file (win32termios.h) getting included with <> . RXTXPort.java - You can get an exception during the writeByte, writeArray, nativeDrain, readByte, read, readArray, readTerminatedArray, and nativeAvailable calls. Without this patch the IOLocked count gets stuck incremented. termios.c - If you try to open a port through CreateFile and get ERROR_ACCESS_DENIED it means someone else is using the port. We need to make sure to use serial_close instead of just close. I found that some devices finish their I/O synchronously. The code was treating this as an error. I also added some checking on the ClearError calls. I found a compile error when debugging is turned on (see the usleep change). SerialImp.c - Again, I don't have a config.h and again we must use quotes and not <> to include win32termios.h . I also commented out a report call since it seems to happen constantly on my system. Feel free to use these in any way that you want or just to ignore them. Thanks! -Dave Acker dacker at nomadio.net Software Engineer Nomadio, Inc. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diffs.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/5671d159/diffs-0395.txt From jon.nall at gmail.com Tue Jun 7 12:28:16 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 13:28:16 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, DEBIEF Eric wrote: > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. Hi. This is helpful, thanks. I can think of 2 reasons I'm not collecting the data as fast as I think I should be: 1) the device to PC connection is not at 100% utilization 2) my SerialPortEventListener processing has too much overhead Are there other explanations I might be missing as to why it takes so long to transfer the data? Thanks. nall. From taj at www.linux.org.uk Tue Jun 7 13:21:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:21:46 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > On 6/7/05, DEBIEF Eric wrote: > > We are "pushing" RxTx /Java here in a half-duplex link. > > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > > and application handling) about 25?s/byte. > > The figures are the barely the same on two environments. > > Hi. > This is helpful, thanks. I can think of 2 reasons I'm not collecting > the data as fast as I think I should be: > 1) the device to PC connection is not at 100% utilization > 2) my SerialPortEventListener processing has too much overhead > > Are there other explanations I might be missing as to why it takes so > long to transfer the data? > Polling the port would probably make more sense. You can set the threshold/timeouts to avoid racing and not deal with the event notification. As mentioned earlier I think the event latency is ~10ms. Keep the event listener around, rxtx 2.* does not close well without it. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 13:27:27 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 14:27:27 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, Trent Jarvi wrote: > Polling the port would probably make more sense. You can set the > threshold/timeouts to avoid racing and not deal with the event > notification. As mentioned earlier I think the event latency is ~10ms. Trent, Thanks for the response. Just to make sure I understand what you're talking about, when you say event latency, do you mean the time it takes from when the byte hits the PC's comm port to when rxtx presents it to user code? So if the link is 100% utilized, will my user code see "hiccups" or a steady stream of data? Thanks for helping a serial port newbie. nall. From dacker at nomadio.net Tue Jun 7 13:32:20 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 15:32:20 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <20050607193118.5499329CAA0@mail.electronpusher.org> Some folks asked about the make file and ant steps. I have JAVA_HOME set as follows: $ echo $JAVA_HOME C:\Program Files\Java\jdk1.5.0_01 I have all the code in rxtx/src put into gnu/io . The make file here doesn't have optimizations turned on. We have not tested with it yet. --------------Begin Makefile------------------ CPPFLAGS="-I$(JAVA_HOME)/include" "-I$(JAVA_HOME)/include/win32" SOBJECTS=SerialImp.o fuserImp.o termios.o fixup.o init.o POBJECTS=ParallelImp.o termios.o init.o DLLS=rxtxParallel.dll rxtxSerial.dll all: $(CLASSES) $(DLLS) rxtxSerial.dll: $(SOBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(SOBJECTS) rxtxParallel.dll: $(POBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(POBJECTS) clean: rm -fv $(SOBJECTS) $(POBJECTS) $(DLLS) %.o: %.c gcc -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< %.o: %.cpp g++ -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< --------------End Makefile------------------ Here is the ant target I use to build the rxtx libs. Our build puts the class files in a bin dir. We copy the dlls to a deploy dir and to the build dir. Eclipse seems to like the dlls in the build dir. The deploy dir is used when we build our full package. --------------Begin Ant Section------------------ --------------End Ant Section------------------ > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > David S. Acker > Sent: Tuesday, June 07, 2005 2:08 PM > To: 'Java RXTX discussion' > Subject: [Rxtx] Patches to 2.1-7pre17 > > Hello, > I am using RxTx with the Nomadio Sensor, > http://www.nomadio.net/ . Our product includes a built in > USB to Serial adapter so that when it is connected to your PC > over USB, it appears as a serial port. We had problems with > Sun's comm library because it did not detect serial ports > coming and going properly. > > I did run into a few issues with RxTx though. I am building > under Windows (we support XP and 2000) under cygwin. I used > a simple make file for the c code that works under cygwin and > ant to build the java stuff. Attached is a diff file. The > patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h > for me. Also, gcc didn't like a local file (win32termios.h) > getting included with <> . > > RXTXPort.java - You can get an exception during the > writeByte, writeArray, nativeDrain, readByte, read, > readArray, readTerminatedArray, and nativeAvailable calls. > Without this patch the IOLocked count gets stuck incremented. > > termios.c - If you try to open a port through CreateFile and > get ERROR_ACCESS_DENIED it means someone else is using the > port. We need to make sure to use serial_close instead of > just close. I found that some devices finish their I/O > synchronously. The code was treating this as an error. I > also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we > must use quotes and not <> to include win32termios.h . I > also commented out a report call since it seems to happen > constantly on my system. > > Feel free to use these in any way that you want or just to > ignore them. > Thanks! > > -Dave Acker > dacker at nomadio.net > Software Engineer > Nomadio, Inc. > From taj at www.linux.org.uk Tue Jun 7 13:37:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:37:45 +0100 (BST) Subject: [Rxtx] Re: Stack Smashing Attack In-Reply-To: <200506072012.48860.ferdinand.tatzig@web.de> References: <200506072012.48860.ferdinand.tatzig@web.de> Message-ID: On Tue, 7 Jun 2005, Ferdinand Tatzig wrote: > Dear Trent > > I am using RXTX for serial port communication between a PC and a payment > transaction terminal. > When I run my application under Windows 2000, an i386-Linux or an i386-FreeBSD > it works as I expect it to do. However, when I start it to run on AMD64 > machine with a 64-bit Gentoo Linux, the VM terminates with the following > error: > > Port found: /dev/ttyS0 > java: stack smashing attack in function configure_port() > > I am using a 64-bit Blackdown-1.4.2-01 VM. > > I have searched the internet but have found no information about this error. > > This is the code of the method which initializes the serial port: > > /** > * initializes a serial port for communication with a terminal; only > * accessible within this class > * > * @param communication > * @param serialPortToBeInitialized > * @param tillInterfaceEventListener > */ > private TillInterfaceSerialPort(Communication communication, > String serialPortToBeInitialized, > TillInterfaceEventListener tillInterfaceEventListener) > throws IOException, PortInUseException, > TillInterfaceSerialPortNotFoundException, > TooManyListenersException, UnsupportedCommOperationException { > serialPortName = "not initialized yet"; > CommPortIdentifier portId = null; > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > boolean portFound = false; > String temporarySerialPortName = "not initialized yet"; > > // look for a serial port > while (portList.hasMoreElements() && !portFound) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > temporarySerialPortName = portId.getName(); > if (temporarySerialPortName.equals(serialPortToBeInitialized)) { > System.out.print("Port found: "); > System.out.println(temporarySerialPortName); > serialPortName = temporarySerialPortName; > portFound = true; > } > } > } > if (portFound) { > > // initialize the found port - this command causes the VM to terminate > serialPort = (SerialPort) portId > .open( > TillInterfaceConstants.APPLICATION_NAME, > TillInterfaceConstants > .TIMEOUT_IN_MILLISECONDS_FOR_OPENING_OF_COMMUNICATION_PORT); > > // add an event listener which listens > // on the serial port and notifies the > // serial port object when input bytes > // have been received at the port > serialPort.addEventListener(tillInterfaceEventListener); > serialPort.notifyOnDataAvailable(true); > > // initialize the physical layer > // parameters of the serial port > serialPort.setSerialPortParams(TillInterfaceConstants.BAUD_RATE, > SerialPort.DATABITS_8, SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > // set the inter-character > // timeout (T2) > serialPort > .enableReceiveTimeout(TillInterfaceConstants.INTERCHARACTER_TIMEOUT_IN_MILLISECONDS); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > } else > throw new TillInterfaceSerialPortNotFoundException(); > } > > Any hint to solve this problem would be kindly appreciated. > The only thing that comes to mind here after looking at the offending function is rxtx used to include asm/termios.h but now we moved to termios.h and had glibc fix their headers. The asm/termios.h caused problems as its termios was smaller than the actual termios. This should be fixed in current rxtx versions but you can just glance at SerialImp.c and make sure it does not include asm/termios.h. I've cc'd the rxtx mail list because there was one other mention of stack problems recently. I have used rxtx on opteron systems with success. I have a bug I'm trying hard to reproduce on suse 64 bit (circa linux 2.4.19) systems though. So far I have not been able to reproduce the bug. That said, with gentoo... I like gentoo but I seriously doubt they do any QA with their kernel and Java. I've seen problems before. If you use gentoo and have Java problems, at least stick to Linus (that is an s there) kernels while using Java. I'm not an expert on gentoo but I've seen patches go into experimental kernels that turn out to break java and are reverted before going to Linus just before I see problems with gentoo on this list. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:16:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:16:14 +0100 (BST) Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: On Tue, 7 Jun 2005, David S. Acker wrote: > Hello, > I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our > product includes a built in USB to Serial adapter so that when it is > connected to your PC over USB, it appears as a serial port. We had problems > with Sun's comm library because it did not detect serial ports coming and > going properly. > > I did run into a few issues with RxTx though. I am building under Windows > (we support XP and 2000) under cygwin. I used a simple make file for the c > code that works under cygwin and ant to build the java stuff. Attached is a > diff file. The patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h for me. Also, > gcc didn't like a local file (win32termios.h) getting included with <> . > > RXTXPort.java - You can get an exception during the writeByte, writeArray, > nativeDrain, readByte, read, readArray, readTerminatedArray, and > nativeAvailable calls. Without this patch the IOLocked count gets stuck > incremented. > > termios.c - If you try to open a port through CreateFile and get > ERROR_ACCESS_DENIED it means someone else is using the port. We need to > make sure to use serial_close instead of just close. I found that some > devices finish their I/O synchronously. The code was treating this as an > error. I also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we must use quotes > and not <> to include win32termios.h . I also commented out a report call > since it seems to happen constantly on my system. > > Feel free to use these in any way that you want or just to ignore them. > Thanks! > Hi Dave These patches look great as is. Thanks. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:33:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:33:16 +0100 (BST) Subject: [Rxtx] Patch to IOLocked (fwd) Message-ID: This appears to be another solution to the locking. Chris, the other option just moves the locking into the finally clause which I think would be a little cleaner though I'm posting this patch to so people can comment. -- Trent Jarvi tjarvi at qbang.org ---------- Forwarded message ---------- Date: Wed, 1 Jun 2005 13:01:32 +0100 From: Christopher Dawes To: taj at www.linux.org.uk Subject: Patch to IOLocked Do you want me to check it out of CVS and then submit changes? Christopher -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXPort.java.diff Type: application/octet-stream Size: 6965 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/c442f9fc/RXTXPort.java-0398.obj From Christopher.Dawes at retail-logic.com Wed Jun 8 00:57:24 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 8 Jun 2005 07:57:24 +0100 Subject: [Rxtx] Patch to IOLocked (fwd) [Virus Checked] In-Reply-To: Message-ID: Agreed, much better Java :-) Thanks Christopher ------------------------------------------- Consultant Engineer Retail Logic Limited Fleet GU51 3TZ Tel: +44 (0)1252 644377 Mob: +44 (0)7899 842759 Fax: +44 (0)1252 776708 rxtx-bounces at mail.electronpusher.org wrote on 07/06/2005 21:33:16: > > This appears to be another solution to the locking. Chris, the other > option just moves the locking into the finally clause which I think would > be a little cleaner though I'm posting this patch to so people can > comment. > > -- > Trent Jarvi > tjarvi at qbang.org > > ---------- Forwarded message ---------- > Date: Wed, 1 Jun 2005 13:01:32 +0100 > From: Christopher Dawes > To: taj at www.linux.org.uk > Subject: Patch to IOLocked > > Do you want me to check it out of CVS and then submit changes? > > Christopher[attachment "RXTXPort.java.diff" deleted by Chris > Dawes/Retaillogic/NISABA] _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx From zempftman at gmail.com Wed Jun 8 07:57:25 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 09:57:25 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Maxwell Zempftman Date: May 27, 2005 5:01 PM Subject: Re: [Rxtx] Kaffe & rxtx & armv5b To: rxtx at mail.linuxgrrls.org Here are the results from working this week: The "NullPointerExceptions" are generated by the software when I choose a bad device file. I discovered that this occurs on the i686-RedHat box as well. This exception seems to be generated only by this particular application, and not by the example programs in contrib. So, for example: java MyApp /dev/null <-- generates NullPointerException java MyApp fake <-- generates NullPointerException java MyApp /dev/ttyS0 <-- does not generate NullPointerException Using the program CommCheck (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it appears as though /dev/ttyS0 is the only valid serial device file on the XScale device, so the errors I was getting are not really be bugs. Although /dev/ttyS0 did not generate NullPointerExceptions, I did encounter this error: --start java MyApp /dev/ttyS0 (going mostly from memory, not exact) PortList.hasMoreElements: true Listening on: /dev/ttyS0 Client connected. >From net: echo kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 vmExcept_setJNIFrame Assert: on 'fp != 0' failed. --end I took a look at exception.h, and it seems as though the problematic code does not exist in newer versions of Kaffe (I have been using CVS-2004-11). Next week I will try to use a newer version, although so far everything but CVS-2004-11 has failed. Also, I the device files I need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with something like this? Thanks, Max. > On 5/21/05, Trent Jarvi wrote: > > I'm not sure what is wrong in the first part. It sounds like your > > application may be swallowing an exception while trying to enumerate the > > port or open it. The usual mistake made it not having permissions to > > either open the port or create the lockfile. There should be examples in > > the contrib directory you can try that enumerate and open ports. Maybe > > that will give you some hints. > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > Sun's code limiting you there though you do need to compile and install > > rxtx for the XScale with Sun's Commapi. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > From taj at www.linux.org.uk Wed Jun 8 08:22:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 15:22:44 +0100 (BST) Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > ---------- Forwarded message ---------- > From: Maxwell Zempftman > Date: May 27, 2005 5:01 PM > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > To: rxtx at mail.linuxgrrls.org > > > Here are the results from working this week: > > The "NullPointerExceptions" are generated by the software when I > choose a bad device file. I discovered that this occurs on the > i686-RedHat box as well. This exception seems to be generated only by > this particular application, and not by the example programs in > contrib. So, for example: > > java MyApp /dev/null <-- generates NullPointerException > java MyApp fake <-- generates NullPointerException > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > Using the program CommCheck > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > appears as though /dev/ttyS0 is the only valid serial device file on > the XScale device, so the errors I was getting are not really be bugs. > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > encounter this error: > > --start > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > PortList.hasMoreElements: true > Listening on: /dev/ttyS0 > Client connected. > >From net: echo > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > --end > > I took a look at exception.h, and it seems as though the problematic > code does not exist in newer versions of Kaffe (I have been using > CVS-2004-11). Next week I will try to use a newer version, although so > far everything but CVS-2004-11 has failed. Also, I the device files I > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > something like this? > In RXTXCommDriver, just look for the following code and add /dev/ttyM to the list. Moxa? if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } So: if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyM", // for Moxa ports "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } Linux just has way too many port types to try enumerating them all. There is potential we can add them back in with udev now. > Thanks, > Max. > > > On 5/21/05, Trent Jarvi wrote: > > > I'm not sure what is wrong in the first part. It sounds like your > > > application may be swallowing an exception while trying to enumerate the > > > port or open it. The usual mistake made it not having permissions to > > > either open the port or create the lockfile. There should be examples in > > > the contrib directory you can try that enumerate and open ports. Maybe > > > that will give you some hints. > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > Sun's code limiting you there though you do need to compile and install > > > rxtx for the XScale with Sun's Commapi. > > > > > > -- > > > Trent Jarvi > > > tjarvi at qbang.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Wed Jun 8 12:16:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 08 Jun 2005 13:16:03 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A60B8D.8080500@cs.umn.edu> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> Message-ID: <42A735E3.8040706@atcorp.com> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual serial comport. This isn't so much of a problem, what is, however, is that the comport does not appear to be able to be set to any arbitrary speed, only those from the data_rate enum. I've not found much on using different speeds, has anyone else encountered anything similar? I greatly appreciate any and all comments and suggestions. Thanks in advance, ~ Shawn Lavelle From zempftman at gmail.com Wed Jun 8 12:50:58 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 14:50:58 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: Thanks Trent! That will solve one of the problems. I don't know when my next chance to work on it will be, but I still need to figure out the error I got when I tried opening '/dev/ttyS0' on the Moxa device regarding a failed assertion, seemed to be a Kaffe issue. Thanks for you help, hope to have results soon, Max Englander. On 6/8/05, Trent Jarvi wrote: > On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > > > ---------- Forwarded message ---------- > > From: Maxwell Zempftman > > Date: May 27, 2005 5:01 PM > > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > > To: rxtx at mail.linuxgrrls.org > > > > > > Here are the results from working this week: > > > > The "NullPointerExceptions" are generated by the software when I > > choose a bad device file. I discovered that this occurs on the > > i686-RedHat box as well. This exception seems to be generated only by > > this particular application, and not by the example programs in > > contrib. So, for example: > > > > java MyApp /dev/null <-- generates NullPointerException > > java MyApp fake <-- generates NullPointerException > > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > > > Using the program CommCheck > > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > > appears as though /dev/ttyS0 is the only valid serial device file on > > the XScale device, so the errors I was getting are not really be bugs. > > > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > > encounter this error: > > > > --start > > > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > > > PortList.hasMoreElements: true > > Listening on: /dev/ttyS0 > > Client connected. > > >From net: echo > > > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > > > --end > > > > I took a look at exception.h, and it seems as though the problematic > > code does not exist in newer versions of Kaffe (I have been using > > CVS-2004-11). Next week I will try to use a newer version, although so > > far everything but CVS-2004-11 has failed. Also, I the device files I > > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > > something like this? > > > > > In RXTXCommDriver, just look for the following code and add /dev/ttyM to > the list. Moxa? > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > So: > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyM", // for Moxa ports > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > Linux just has way too many port types to try enumerating them all. There > is potential we can add them back in with udev now. > > > > > Thanks, > > Max. > > > > > On 5/21/05, Trent Jarvi wrote: > > > > I'm not sure what is wrong in the first part. It sounds like your > > > > application may be swallowing an exception while trying to enumerate the > > > > port or open it. The usual mistake made it not having permissions to > > > > either open the port or create the lockfile. There should be examples in > > > > the contrib directory you can try that enumerate and open ports. Maybe > > > > that will give you some hints. > > > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > > Sun's code limiting you there though you do need to compile and install > > > > rxtx for the XScale with Sun's Commapi. > > > > > > > > -- > > > > Trent Jarvi > > > > tjarvi at qbang.org > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- > Trent Jarvi > tjarvi at qbang.org > From taj at www.linux.org.uk Wed Jun 8 12:53:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 19:53:10 +0100 (BST) Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A735E3.8040706@atcorp.com> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: On Wed, 8 Jun 2005, Shawn Lavelle wrote: > Hello, > I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate > with a virtual serial comport. This isn't so much of a problem, what > is, however, is that the comport does not appear to be able to be set to > any arbitrary speed, only those from the data_rate enum. I've not found > much on using different speeds, has anyone else encountered anything > similar? I greatly appreciate any and all comments and suggestions. > This problem is a bit more tricky than it should be. POSIX systems just have a few specified baud rates. Solaris is one of these systems. CommAPI baud rates probably came from someone looking at Solaris. RXTX tries to be POSIX like. W32 is treated as a POSIX like system via a termios.c file in rxtx. Serial ports have baudbase and divisor. So you can set these to come close to the baudrate you want. Some funky equipment like automobile test equipment use baud rates that are not really possible with PC hardware. But if you get as close as possible by changing baud base and divisor, it works. Windows can actually do this for you. I don't know exactly what their code does but if you pass a baudrate to windows, it will guestimate a baudbase and divisor. So you just pass it 10200 baud and it does its job. This is not of very much use the way rxtx does things though. Linux has the standard POSIX like baud rates but if you set the baud rate to B38400, you can set your own baud base and divisor. This is not POSIX that I know of. W32 has more capability than POSIX like systems too. So I did some work to have windows work like Linux via termios.c But the code is not quit right. SerialImp.c and termios.c need some work so all the various buadrates work on Linux and W32. Most other systems will not work beyond what CommAPI already specifies without writting kernel drivers. This is on my todo list but if someone gets to it first, all the better. -- Trent Jarvi tjarvi at qbang.org From carobizar at free.fr Thu Jun 9 06:39:10 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Thu, 9 Jun 2005 14:39:10 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: <1118320750.42a8386e6d3ce@imp5-q.free.fr> Hi ! Thank you for all your advices. I managed to use rxtx on Windows but I have still some difficulties on Linux. I have yet follow your instructions and the configure file has created : - librxtxSerial.so and librxtxParallel.so in the directory /usr/java/j2sdk1.4.2_08/jre/lib/i386 - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the directory /usr/java/j2sdk1.4.2_08/jre/lib - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext But when I run my program, Some exceptions occur : Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver So, 1) What have I forgotten ? 2) Is it possible to make my application run on Linux without the jdk (only the jre) ? Best regards, Caroline. From taj at www.linux.org.uk Thu Jun 9 07:28:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 9 Jun 2005 14:28:05 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118320750.42a8386e6d3ce@imp5-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: On Thu, 9 Jun 2005 carobizar at free.fr wrote: > Hi ! > Thank you for all your advices. > I managed to use rxtx on Windows but I have still some difficulties on Linux. > I have yet follow your instructions and the configure file has created : > - librxtxSerial.so and librxtxParallel.so in the directory > /usr/java/j2sdk1.4.2_08/jre/lib/i386 > - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the > directory /usr/java/j2sdk1.4.2_08/jre/lib > - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext > > But when I run my program, Some exceptions occur : > Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while > loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > com.sun.comm.SolarisDriver > > So, > 1) What have I forgotten ? > The native (.so) libraries are not installed in a directory the JRE is looking for native libraries in. You may look around and see where the .so libraries are in the JRE. I don't know that the jre/lib/i386 directory is specified as a required directory for JREs. I noticed some do not use it. You may try printing the java.libarary.path to see your options. It is also possible to alter the java.library.path. > 2) Is it possible to make my application run on Linux without the jdk (only the > jre) ? Yes. Though installation from source with the JDK is less error prone. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0395.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 7 15:03:09 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 07 Jun 2005 16:03:09 -0500 Subject: [Rxtx] Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <42A60B8D.8080500@cs.umn.edu> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual comport. This isn't so much of a problem, what is, however, is that the comport is only ever set to 9600 baud. I've not found this as a documented bug, has anyone else encountered anything similar? I'll try and provide more detail tomorrow, but if anyone has any suggestions or encountered this before, I'd like to hear about it. Thanks in advance, ~ Shawn Lavelle From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0398.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0398.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0398.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Mon Jun 20 01:04:40 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 20 Jun 2005 08:04:40 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: <42B66A88.4060806@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050620/9be208a1/attachment-0398.html From fbalzarro at libero.it Mon Jun 20 02:33:52 2005 From: fbalzarro at libero.it (Fabio Balzarro) Date: Mon, 20 Jun 2005 10:33:52 +0200 Subject: [Rxtx] RXTXPort:close detected bad file descriptor Message-ID: I'm using RXTX libraries on IPAQ 4150 PDA with Windows CE 4.20 and Jeode. When I close a serial port with sp.close() (where sp is a SerialPort) sometimes an error occour 1119256168085: RXTXPort:close detected bad file descriptor What can I do? Thanks Fabio ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From slavelle at atcorp.com Mon Jun 20 08:08:19 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 20 Jun 2005 09:08:19 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: <42B6CDD3.4040409@atcorp.com> It turns out that I did have a driver-not-used issue which has now been resolved and I can use RxTx on it (had to add ttyUSB as a valid port), but only at standard baud rates. Does USB have the same restrictions on port speed as regular RS232? ~ Shawn Trent Jarvi wrote: > Just a note here. > > I have requested a FTDI usb device and they offered to send one for the > purpose of trying to get rxtx working. I have no idea how long that takes > though. > > > On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > > >>I'm afraid we're just using the latest version from the FTDI website. I've >>not yet played with linux properly with this and unfortunately I run gentoo >>and haven't yet successfully compiled in the ftdi driver. I'll let you know >>if I get any success. >> >>Appologies >> >>Christopher >> >>-----Original Message----- >>From: rxtx-bounces at mail.electronpusher.org >>[mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle >>Sent: 15 June 2005 00:00 >>To: Java RXTX discussion >>Subject: Re: [Rxtx] Virtual Com Ports >> >>Hmm, the latter sounds like a lot of work. It does find the virtual comport >>in windows, i must have just missed it earlier (sign of a long day). On the >>linux side, I suspect that something is not correct with the driver >>installation becuase it does not give me a tty for it :( >> >>Christopher, May I ask what driver you are using for your FTDI chip? >>Did you ever encounter problems with not getting a tty assigned for it? >> >> >> Thanks for all your help! >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>They will have to show up as a tty device in Linux. Probably ttyUSB? >>>That will need an entry in RXTXCommDriver.java. If they dont show up >>>as a tty device, rxtx cant treat it like a serial port. It just wont >> >>work. >> >>>With COM3, rxtx will try to open the port and perform a timed out read. >>>Usually if a port is not there, the read blows up or the open blows up. >>>Timing out is fine. COM3 used to share interrupts with COM1. I know >>>you can reassign ports in XP. RXTX scans up through COM255. You may >>>try moving it. >>> >>> >>>The code in question is the following in RXTXCommDriver.java >>> >>> >>> if(osName.equals("Linux")) >>> { >>> String[] Temp = { >>> "ttyS", // linux Serial Ports >>> "ttySA", // for the IPAQs >>> "ttyUSB" // for USB frobs >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>> else if(osName.toLowerCase().indexOf("windows") != -1 ) >>> { >>> String[] Temp = { >>> "COM" // win32 serial ports >>> //"//./COM" // win32 serial ports >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>>If COM3 can be read, it should be found. the ttyUSB should work if >>>thats in the version of RXTXCommDriver.java you have. >>> >>>If this is still a problem, it may be that the driver is erroring on >>>what may be considered normal comm port operations such as setting the >>>speed, timeout, threshold, .. One would have to start looking at each >>>function called in the native open() and read(). >>> >>> >>> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>>seems to find the device using rxtx. Looking at the hardware >>>>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>>>linux. I can't seem to get it to show up as a tty(s#) in linux which >>>>is probably just due to my lack of significant linux knowledge. >>>> >>>> ~ Shawn >>>> >>>>Trent Jarvi wrote: >>>> >>>> >>>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>Has anyone here noticed that virtual comports do not get enumerated >>>>>>via CommPortIdentifier.getPortIdentifiers()?? >>>>>> >>>>>>The device I'm trying to talk to uses an fdti usb to serial >>>>>>convertor with a driver that has it show up as a virtual comport. I >>>>>>can enter this port manually and it will be usable but I cannot get >>>>>>it show up automatically (as in the simple serial demo). Any thoughts >> >>on this? >> >>>>> >>>>>Hi Shawn, >>>>> >>>>>What OS is this and what is the name of the virtual port you are >>>>>trying to open? I suspect the name just needs to be added to >> >>RXTXCommDriver.java. >> >>>>_______________________________________________ >>>>Rxtx mailing list >>>>Rxtx at mail.electronpusher.org >>>>http://www.electronpusher.org/mailman/listinfo/rxtx >>>> >>> >>> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From lyon at docjava.com Mon Jun 20 15:06:08 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 20 Jun 2005 17:06:08 -0400 Subject: [Rxtx] testing Message-ID: Hi All, I am testing my new multi-platform Java Webstart RXTX application (Trent: I could not have done it without you!). So far, I think it will work under Linux (x86), Windows XP, Windows 2000 and MacOS X. The application is available as a Java webstart application at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Edit:Preferences: SerialPort Setup... should bring up a dialog box that enables dialing via the modem. Generally, it does not find internal modems (except on the mac). Why, I don't know. Thanks in advance for trying this new app. All feedback on it is welcome. - Doug Lyon From jasmine at electronpusher.org Tue Jun 21 04:15:53 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Tue, 21 Jun 2005 11:15:53 +0100 Subject: [Rxtx] testing In-Reply-To: References: Message-ID: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > Hi All, > I am testing my new multi-platform Java Webstart RXTX application > (Trent: I could not have done it without you!). > > So far, I think it will work under Linux (x86), Windows XP, > Windows 2000 and MacOS X. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. -J. From taj at www.linux.org.uk Tue Jun 21 05:50:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 12:50:23 +0100 (BST) Subject: [Rxtx] testing In-Reply-To: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> References: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> Message-ID: On Tue, 21 Jun 2005, Jasmine Strong wrote: > > On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > > > Hi All, > > I am testing my new multi-platform Java Webstart RXTX application > > (Trent: I could not have done it without you!). > > > > So far, I think it will work under Linux (x86), Windows XP, > > Windows 2000 and MacOS X. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > on my Mac. > passing -source 1.3 -target 1.3 to javac will compile classes without this problem. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 10:19:25 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 11:19:25 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. Sincerely, Jeremyah Payne From ricardo.trindade at emation.pt Tue Jun 21 13:25:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 20:25:00 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B8698C.2060509@emation.pt> Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > From taj at www.linux.org.uk Tue Jun 21 13:39:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:39:43 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <42B8698C.2060509@emation.pt> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> <42B8698C.2060509@emation.pt> Message-ID: It looks like he has an rs422 device/converter. This is not the problematic 'trying to do protocol X with a serial port' situation unless I'm missing something. I'll follow up with the other email I started. On Tue, 21 Jun 2005, Ricardo Trindade wrote: > Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. > > Payne, Jeremyah L (N-CIM) wrote: > > >Good morning, my name is Jeremyah and I am working on a java project to > >interface with some devices. In short, I have a laptop with a PCMIA > >converter that does RS422 running windows 2000. I also will be > >installing some PCI cards into some Linux boxes that will have probably > >4-8 RS422 ports on them. After doing some reading in order to talk > >with these items using my existing java code I will need an additional > >driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > >trying to get a map sort of where I need to make changes. As I see it, > >I would need to subclass SerialPort to my RS422 interface. That would > >link with a DLL or SO implementation that talks with the hardware. I > >also need to change the listing of working ports in the lookup section > >for serial. Does this seem like I am on the right track? Appreciate > >the support. > > > > > >Sincerely, > >Jeremyah Payne > >_______________________________________________ > >Rxtx mailing list > >Rxtx at mail.electronpusher.org > >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 21 13:40:25 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:40:25 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: On Tue, 21 Jun 2005, Payne, Jeremyah L (N-CIM) wrote: > Good morning, my name is Jeremyah and I am working on a java project to > interface with some devices. In short, I have a laptop with a PCMIA > converter that does RS422 running windows 2000. I also will be > installing some PCI cards into some Linux boxes that will have probably > 4-8 RS422 ports on them. After doing some reading in order to talk with > these items using my existing java code I will need an additional > driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > trying to get a map sort of where I need to make changes. As I see it, I > would need to subclass SerialPort to my RS422 interface. That would link > with a DLL or SO implementation that talks with the hardware. I also > need to change the listing of working ports in the lookup section for > serial. Does this seem like I am on the right track? Appreciate the > support. > Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 13:40:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 14:40:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618954@emss02m08.us.lmco.com> I'd like to except I am dealing with NASA. I am basically building a system to monitor 100+ Units that communicate over RS422. They have some converters in place but want to get rid of them. I'll check through the archives. I had started looking yesterday as was leaving work. -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Ricardo Trindade Sent: Tuesday, June 21, 2005 2:25 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From slavelle at atcorp.com Tue Jun 21 14:58:06 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 21 Jun 2005 15:58:06 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: <42B87F5E.4000403@atcorp.com> > Linux has the standard POSIX like baud rates but if you set the baud rate > to B38400, you can set your own baud base and divisor. This is not POSIX > that I know of. W32 has more capability than POSIX like systems too. So > I did some work to have windows work like Linux via termios.c > > But the code is not quit right. SerialImp.c and termios.c need some > work so all the various buadrates work on Linux and W32. Most other > systems will not work beyond what CommAPI already specifies without > writting kernel drivers. > > This is on my todo list but if someone gets to it first, all the better. Hmm, I guess I didn't read this close enough before. Just to be clear, the pieces to setBaudBase and setDivisor are not yet implemented, correct? Thanks, Shawn From sean_montgomery at baseview.com Tue Jun 21 15:14:08 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 21 Jun 2005 17:14:08 -0400 Subject: [Rxtx] OS X installation - file locations Message-ID: <8AB82C7F-0D19-45F9-AE54-A12C59A8495E@baseview.com> Greetings, I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) using the RXTX installation instructions. RXTX worked fine. Basically you've got: - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions - javax.comm.properties in /System/Library/Frameworks/ JavaVM.framework/Home/lib - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ lib/ext My coworker was concerned that the installation required files to be placed in /System/Library... because those directories are "Apple's" and subject to change at Apple's whim, and that it would be safer (less likely to break when a user updates their OS or Java version or what have you) if all the files could be somewhere in /Library... or / Library/Java. My coworker points out that when 3rd party apps like FrontBase and JBoss need to communicate with Java their jars are placed in /Library/Java/Extensions. Granted that RXTX 2.0 is implementing javax.comm and not just a 3rd party extension, might that be the case - that javax.* stuff needs to be in the Java system files? I'm not the Java maven that my coworker is, so I don't know if any of this is gospel or not. Any OS X/Java experts out there willing to comment? We'd like to be able to install RXTX in the safest, most maintenance free way possible, but if there are specific reasons why javax.comm.properties and comm.jar need to be in /System... then so be it. Any information is welcome, Sean From ricardo.trindade at emation.pt Tue Jun 21 15:56:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 22:56:53 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B88D25.7060604@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050621/f6c9f5fe/attachment-0398.html From jeremyah.l.payne at lmco.com Tue Jun 21 15:22:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 16:22:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618955@emss02m08.us.lmco.com> -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Trent Jarvi Sent: Tuesday, June 21, 2005 2:40 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 As of yet we have not decided on the PCI boards to use yet So I am still waiting to se how we will interface to them. But the laptop is ready to use so ill build a test app for that API for now. The overview of class structure is really what I needed. I guess I will use the 2.1 as you suggested. Thanks for the help thus far! BTW, you guys wouldn't happen to keep class diagrams or anything of that nature around would you? If not I will probably end up having to do some anyway for documentation purposes, I could include them. Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From dmarkman at mac.com Tue Jun 21 18:13:28 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 21 Jun 2005 20:13:28 -0400 Subject: [Rxtx] OS X installation - file locations In-Reply-To: References: Message-ID: <044F520C-585C-4B99-82ED-3BA83DB8CE77@mac.com> Apple doesn't recommend to put jars into the /System/Library/Frameworks/JavaVM.framework/Home/lib/ext folder from other hands it's standard java directory to put extentions if you want to support comm api on whole system then I'd recommend to put jars into the /Library/Java/Extensions folder just like you did if you want to support comm api per user put your jars into the ~/ Library/Java/Extensions On Jun 21, 2005, at 5:14 PM, Java RXTX discussion wrote: > Greetings, > > > I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) > using the RXTX installation instructions. RXTX worked fine. > > > Basically you've got: > - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions > - javax.comm.properties in /System/Library/Frameworks/ > JavaVM.framework/Home/lib > - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ > lib/ext > > > My coworker was concerned that the installation required files to be > placed in /System/Library... because those directories are "Apple's" > and subject to change at Apple's whim, and that it would be safer > (less likely to break when a user updates their OS or Java version or > what have you) if all the files could be somewhere in /Library... or / > Library/Java. My coworker points out that when 3rd party apps like > FrontBase and JBoss need to communicate with Java their jars are > placed in /Library/Java/Extensions. Granted that RXTX 2.0 is > implementing javax.comm and not just a 3rd party extension, might > that be the case - that javax.* stuff needs to be in the Java system > files? > > > I'm not the Java maven that my coworker is, so I don't know if any of > this is gospel or not. Any OS X/Java experts out there willing to > comment? We'd like to be able to install RXTX in the safest, most > maintenance free way possible, but if there are specific reasons why > javax.comm.properties and comm.jar need to be in /System... then so > be it. > > > Any information is welcome, > > > Sean > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Dmitry Markman Dmitry Markman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050622/beea65d0/attachment-0398.html From lyon at docjava.com Thu Jun 23 04:39:47 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 23 Jun 2005 06:39:47 -0400 Subject: [Rxtx] web start + RXTX = strange errors? Message-ID: On: Date: Tue, 21 Jun 2005 11:15:53 +0100 From: Jasmine Strong Writes: An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. ----------- I cannot duplicate your error. My version of Java is: java -version java version "1.4.2_05" Is yours the same? Trent: You wrote: passing -source 1.3 -target 1.3 to javac will compile classes without this problem. ----------- OK, I have updated the disto to work with jdk1.3: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Jasmine: Is this working any better? Thanks! - DL From handzisk at tkn.tu-berlin.de Fri Jun 24 02:37:14 2005 From: handzisk at tkn.tu-berlin.de (Vlado Handziski) Date: Fri, 24 Jun 2005 10:37:14 +0200 (CEST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace Message-ID: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Hi all, let me first express my compliments on the great work you have done with the RXTX library. We have been using the library for some time, and we are at a point where we want to make our code public. For legacy reasons, the code that the RXTX library is bundled with, uses the javax.comm namespace. We have been using the ChangePackage script to change the RXTX2.1 package from gnu.io into javax.comm. We need the independent implementation since we want to be able to directly access /dev/ttyUSBx ports in linux and the CommAPI versions are just not as stable. On the download page, there is a comment that this is in violation of sun's license. Can someone shed more light on this. I was not aware that you can protect the names of the java packages. Best regards, Vlado From ricardo.trindade at emation.pt Fri Jun 24 04:01:17 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 11:01:17 +0100 Subject: [Rxtx] parity missed Message-ID: <42BBD9ED.3060004@emation.pt> Hi, I have a "parity missed error". From previous posts I believe this has to do with CMSPAR not being defined. I checked out 2.1 head from CVS. How can I make sure I do a proper build and CMSPAR is defined ? Perhaps it would be good to have a release snapshot that has this, I think the latest snapshot (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. Another question I have, is why must this depend on kernel headers, why can't it be defined in the RXTX source ? thanks Ricardo From jasmine at electronpusher.org Fri Jun 24 04:09:06 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 24 Jun 2005 11:09:06 +0100 Subject: [Rxtx] web start + RXTX = strange errors? In-Reply-To: References: Message-ID: <644aad2bdbba950f0a2fb12d7dcfd8a6@electronpusher.org> On 23 Jun 2005, at 11:39, Dr. Douglas Lyon wrote: > OK, I have updated the disto to work with jdk1.3: > http://show.docjava.com:8086/book/cgij/code/jnlp/ > addbk.JAddressBook.Main.jnlp > > Jasmine: Is this working any better? Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) -J. From taj at www.linux.org.uk Fri Jun 24 10:54:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 17:54:12 +0100 (BST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: On Fri, 24 Jun 2005, Vlado Handziski wrote: > Hi all, > > let me first express my compliments on the great work you have done with > the RXTX library. > > We have been using the library for some time, and we are at a point where > we want to make our code public. For legacy reasons, the code that the > RXTX library is bundled with, uses the javax.comm namespace. We have been > using the ChangePackage script to change the RXTX2.1 package from gnu.io > into javax.comm. We need the independent implementation since we want to > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > versions are just not as stable. > > On the download page, there is a comment that this is in violation of > sun's license. Can someone shed more light on this. I was not aware that > you can protect the names of the java packages. > > Best regards, > Vlado > I can't provide legal advice as I am not a lawyer. (v) may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are contained in the "java", "javax" or "sun" packages or similar as specified by Sun in any class file naming convention; and The license is in the commapi package from Sun. The above is also in all the EULA's you click through to download from Sun if I'm not mistaken. Simply put, the license taints developers that agree to it. For those developers, Sun has control of the javax.comm namespace. It really does not make sense to put rxtx 2.1 in the javax.comm namespace. It will only cause confusion which I think is the point of the clause above. The gnu.io namespace was perhaps a poor choice and just tossed in when reviewing the license to get out of Sun's namespace. There is nothing in the rxtx license limiting your freedom in this fashion though. Many companies are moving to gnu.io and some distribute it with popular applications you would recognize. I'm tempted to ask you not to contaminate rxtx 2.1 with the javax.comm namespace. You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) extensions to existing classes (which I dont think you are using); it is not just javax.comm. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 24 13:24:09 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 20:24:09 +0100 (BST) Subject: [Rxtx] parity missed In-Reply-To: <42BBD9ED.3060004@emation.pt> References: <42BBD9ED.3060004@emation.pt> Message-ID: On Fri, 24 Jun 2005, Ricardo Trindade wrote: > Hi, > > I have a "parity missed error". From previous posts I believe this > has to do with CMSPAR not being defined. > I checked out 2.1 head from CVS. How can I make sure I do a proper > build and CMSPAR is defined ? Perhaps it would be good to have a release > snapshot that has this, I think the latest snapshot > (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. > > Another question I have, is why must this depend on kernel headers, > why can't it be defined in the RXTX source ? > I used to cheat and grab the CMSPAR from the kernel headers because glibc did not have it. Now rxtx uses the glibc headers and we have a patch in glibc I trust that handles this. It would not be right to override glibc and it wasnt right to use the kernel headers (it really did cause problems). You can override glibc for now with the following in the top of SerialImp.c # define CMSPAR 010000000000 You can check if your distro headers have this right bit looking for the above in bits/termios.h. It should look like this: #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif If it is not defined, please file a bug with your distro as rxtx is not the only thing that will be broken on that distro. I was going to release new cvs snapshots last weekend but got tied up. I'll do it this weekend. I also need to get custom baudrate patches into the cvs snapshot. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Fri Jun 24 13:56:50 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 20:56:50 +0100 Subject: [Rxtx] parity missed In-Reply-To: References: <42BBD9ED.3060004@emation.pt> Message-ID: <42BC6582.2070805@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050624/e3b39631/attachment-0398.html From vlado.handziski at gmail.com Sat Jun 25 06:25:52 2005 From: vlado.handziski at gmail.com (Vlado Handziski) Date: Sat, 25 Jun 2005 14:25:52 +0200 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: <697986ec05062505256ebf381f@mail.gmail.com> Thanks for the clarification. Since changing the bundled source is not an option at this moment, we will consider using javax.comm and RXTX2.0. In the next rewrite, we would probably move to gnu.io . Best regards, Vlado Handziski On 6/24/05, Trent Jarvi wrote: > > On Fri, 24 Jun 2005, Vlado Handziski wrote: > > > Hi all, > > > > let me first express my compliments on the great work you have done with > > the RXTX library. > > > > We have been using the library for some time, and we are at a point > where > > we want to make our code public. For legacy reasons, the code that the > > RXTX library is bundled with, uses the javax.comm namespace. We have > been > > using the ChangePackage script to change the RXTX2.1 package from gnu.io > > into javax.comm. We need the independent implementation since we want to > > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > > versions are just not as stable. > > > > On the download page, there is a comment that this is in violation of > > sun's license. Can someone shed more light on this. I was not aware that > > you can protect the names of the java packages. > > > > Best regards, > > Vlado > > > > I can't provide legal advice as I am not a lawyer. > > (v) may not create, or authorize your licensees to create additional > classes, interfaces, or subpackages that are contained in the "java", > "javax" or "sun" packages or similar as specified by Sun in any class file > naming convention; and > > The license is in the commapi package from Sun. The above is also in all > the EULA's you click through to download from Sun if I'm not mistaken. > > Simply put, the license taints developers that agree to it. For those > developers, Sun has control of the javax.comm namespace. > > It really does not make sense to put rxtx 2.1 in the javax.comm namespace. > It will only cause confusion which I think is the point of the clause > above. The gnu.io namespace was perhaps a poor choice and > just tossed in > when reviewing the license to get out of Sun's namespace. > > There is nothing in the rxtx license limiting your freedom in this fashion > though. Many companies are moving to gnu.io and some > distribute it with > popular applications you would recognize. I'm tempted to ask you not > to contaminate rxtx 2.1 with the javax.comm namespace. > > You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm > using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) > extensions to existing classes (which I dont think you are using); it is > not just javax.comm. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050625/1dadc50e/attachment-0398.html From taj at www.linux.org.uk Sun Jun 26 11:34:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 26 Jun 2005 18:34:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. Message-ID: The attached file should fix baud_base and divisor extensions for Linux The patch is against rxtx 2.1 CVS HEAD. To use this patch, you should set the baud rate to 38400. You can then try SerialPort.setBaudBase(int) and SerialPort.setDivisor(int) There are matching int SerialPort.getBaudBase() and int SerialPort.getDivisor(). What baud bases are available depends upon the serial port card and its driver so this is a bit of a blind attempt on my part. I've looked at the w32 API and I dont see anything available yet. The w32 code in RXTX will probably be figuring out the baud rate based on the tried baud base and divisor and just slamming it at the API for now (the API does something with that but I've not found real documentation on what it does). I dont want to try tinkering with the UART directly yet as that would involve poking machine memory directly and could very easily be error prone in bad ways. I don't expect Solaris or any SysV UNIX systems to work at all with this - ever. It is not standard in any way and will throw Exceptions on everything but Linux (w32 will just fail miserably as it is 1/2 implemented). If anyone has looked at custom baud rates before and has some thoughts or just wants to try the attached untested patch, I'd appreciate any feedback. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- ? autom4te.cache ? build ? output cvs server: Diffing . Index: configure =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure,v retrieving revision 1.35.2.59 diff -u -r1.35.2.59 configure --- configure 16 Oct 2004 16:20:34 -0000 1.35.2.59 +++ configure 26 Jun 2005 16:59:28 -0000 @@ -9644,6 +9644,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { #if defined (__GLIBC__) @@ -9782,6 +9784,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { @@ -9825,7 +9829,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -9837,7 +9841,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 26 Jun 2005 16:59:28 -0000 @@ -218,6 +218,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { #if defined (__GLIBC__) @@ -356,6 +358,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { @@ -399,7 +403,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -411,7 +415,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" cvs server: Diffing CNI cvs server: Diffing MACOSX_IDE cvs server: Diffing MACOSX_IDE/CW cvs server: Diffing MACOSX_IDE/ForPackageMaker cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions cvs server: Diffing MACOSX_IDE/ForPackageMaker/Resources cvs server: Diffing MACOSX_IDE/PB cvs server: Diffing WinCE cvs server: Diffing contrib cvs server: Diffing debian cvs server: Diffing src Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 26 Jun 2005 16:59:29 -0000 @@ -2079,15 +2079,17 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int BaudBase The clock frequency divided by 16. Default * BaudBase is 115200. * @return boolean true on success - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:setBaudBase()"); @@ -2097,10 +2099,11 @@ /** * Extension to CommAPI * @return int BaudBase - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getBaudBase() throws UnsupportedCommOperationException + public int getBaudBase() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getBaudBase()"); @@ -2108,13 +2111,14 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, IOException { if ( debug ) z.reportln( "RXTXPort:setDivisor()"); @@ -2124,10 +2128,11 @@ /** * Extension to CommAPI * @returns int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getDivisor() throws UnsupportedCommOperationException + public int getDivisor() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getDivisor()"); Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 26 Jun 2005 16:59:30 -0000 @@ -1877,16 +1877,27 @@ int fd = get_java_var( env, jobj,"fd","I" ); struct serial_struct sstruct; + if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) + { + goto fail; + } + + sstruct.baud_base = (int) BaudBase; + if ( sstruct.baud_base < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetBaudBase", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetBaudBase", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1914,9 +1925,13 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) ( sstruct.baud_base ) ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetBaudBase", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetBaudBase", strerror( errno ) ); @@ -1950,19 +1965,23 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } if ( sstruct.custom_divisor < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetDivisor", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetDivisor", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1971,7 +1990,7 @@ accept: none perform: Find the Divisor used for custom speeds - return: Divisor + return: Divisor negative value on error. exceptions: Unsupported Comm Operation on systems not supporting TIOCGSERIAL comments: @@ -1990,10 +2009,14 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) sstruct.custom_divisor ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetDivisor", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetDivisor", strerror( errno ) ); @@ -2032,7 +2055,7 @@ /* Open and lock the port so nothing else changes the setting */ - if ( LOCK( filename, pid ) ) goto fail;; + if ( LOCK( filename, pid ) ) goto fail; fd = find_preopened_ports( filename ); if( !fd ) Index: src/SerialPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/Attic/SerialPort.java,v retrieving revision 1.3.2.9 diff -u -r1.3.2.9 SerialPort.java --- src/SerialPort.java 12 Oct 2004 08:59:28 -0000 1.3.2.9 +++ src/SerialPort.java 26 Jun 2005 16:59:30 -0000 @@ -103,13 +103,17 @@ public abstract String getUARTType() throws UnsupportedCommOperationException; public abstract boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getBaudBase() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getDivisor() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setLowLatency() throws UnsupportedCommOperationException; public abstract boolean getLowLatency() cvs server: Diffing src/lfd cvs server: Diffing src/psmisc From uwe at kubosch.no Mon Jun 27 14:13:57 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Mon, 27 Jun 2005 22:13:57 +0200 Subject: [Rxtx] RXTX on FC4 Message-ID: <1119903238.2989.27.camel@BPC0276> Hi all! I just got RXTX to work on Fedora Core 4. The standard download did not work. I had to check the code out from CVS and build it, but then it worked flawlessly. Thanks for your good work. Now I wonder if I should contribute the compiled files so that others will have an easier time than me getting RXTX to work on FC4. What do I do? Who do I talk to? donV From taj at www.linux.org.uk Mon Jun 27 14:29:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 27 Jun 2005 21:29:46 +0100 (BST) Subject: [Rxtx] RXTX on FC4 In-Reply-To: <1119903238.2989.27.camel@BPC0276> References: <1119903238.2989.27.camel@BPC0276> Message-ID: On Mon, 27 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I just got RXTX to work on Fedora Core 4. > > The standard download did not work. > > I had to check the code out from CVS and build it, but then it worked > flawlessly. > > Thanks for your good work. > > Now I wonder if I should contribute the compiled files so that others > will have an easier time than me getting RXTX to work on FC4. What do I > do? Who do I talk to? > > The best thing to do with FC is to contibute an extras RPM. Debian does something like this with their .deb packaging. As rxtx is OS neutral, it is almost impossible to have everything on rxtx.org. If you do get a package in Fedora Extras, I can point a link there. The extra's mail list is here: https://www.redhat.com/mailman/listinfo/fedora-extras-list If it would help to have me release a 'stable' .tar.gz of the source for the RPM submittal process I can do that. It would also trigger upgrades in debian which would not be bad. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Mon Jun 27 16:23:20 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 27 Jun 2005 17:23:20 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: Message-ID: <42C07C58.1030608@atcorp.com> Hey Trent, I installed it and now I get IOExceptions instead of the other one. I'm not sure how those changes would have enabled setDivisor and setBaudBase to work though. Is it significant that this is a USB device emulating a serial port? ~ Shawn From taj at www.linux.org.uk Mon Jun 27 18:07:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 01:07:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: <42C07C58.1030608@atcorp.com> References: <42C07C58.1030608@atcorp.com> Message-ID: On Mon, 27 Jun 2005, Shawn Lavelle wrote: > Hey Trent, > I installed it and now I get IOExceptions instead of the other one. > I'm not sure how those changes would have enabled setDivisor and > setBaudBase to work though. Is it significant that this is a USB device > emulating a serial port? > The USB driver probably does not support this. With USB, the ioctl()'s appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through the linux drivers/usb tree and found to ioctl to support this in Linux 2.6.10. RXTX is not doing very much magic, the patch really only gets the serial struct instead of writing a structure with random values for baudbase and handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel level driver issue not a user space library issue. So if you wanted this to work, the usb serial driver would have to handle the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression after looking through the USB tree quickly. I hope that helps. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Jun 27 18:25:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 27 Jun 2005 20:25:22 -0400 Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) Message-ID: Hi All, I wrote: Jasmine: Is this working any better? And Jasmine says: Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) I am using -source 1.3 and -target 1.3 for the compilation, however, we still seem to have this problem, which my machine (for some reason) does not have. Does anyone have any ideas about what might be the problem? Thanks! - DL From taj at www.linux.org.uk Mon Jun 27 19:04:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 02:04:37 +0100 (BST) Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) In-Reply-To: References: Message-ID: On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I wrote: > Jasmine: Is this working any better? > > And Jasmine says: > Nope. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > > I am using -source 1.3 and -target 1.3 > for the compilation, however, we still seem to have this problem, > which my machine (for some reason) does not have. > Does anyone have any ideas about what might be the problem? > This has shown up in the past with jdk 1.5 compiled jars running on jre 1.4 machines. My guess is either jasmine has an old copy of rxtx with the problem on her machine that is being picked up on the classpath or you have not tried this with jre 1.4. The suggested -source/target fix should avoid the problem. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Mon Jun 27 21:23:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 04:23:55 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: On Tue, 28 Jun 2005, Trent Jarvi wrote: > On Mon, 27 Jun 2005, Shawn Lavelle wrote: > > > Hey Trent, > > I installed it and now I get IOExceptions instead of the other one. > > I'm not sure how those changes would have enabled setDivisor and > > setBaudBase to work though. Is it significant that this is a USB device > > emulating a serial port? > > > > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > > RXTX is not doing very much magic, the patch really only gets the serial > struct instead of writing a structure with random values for baudbase and > handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel > level driver issue not a user space library issue. > > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. > > I hope that helps. > > > It may be possible that you can just modify translate_speed and get_java_baudrate in SerialImp.c to have the new high speds you are after. The defines are in /usr/include/termios.h. #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 You can see many of these are not handled. I dont think CommAPI handled more than 57600 or so. int get_java_baudrate( int native_speed ) { switch( native_speed ) { case B0: return 0; case B50: return 50; case B75: return 75; case B110: return 110; case B134: return 134; case B150: return 150; case B200: return 200; case B300: return 300; case B600: return 600; case B1200: return 1200; case B1800: return 1800; case B2400: return 2400; case B4800: return 4800; case B9600: return 9600; case B19200: return 19200; case B38400: return 38400; case B57600: return 57600; default: return -1; } } int translate_speed( JNIEnv *env, jint speed ) { LEAVE( "RXTXPort:translate_speed" ); switch( speed ) { case 0: return B0; case 50: return B50; case 75: return B75; case 110: return B110; case 134: return B134; case 150: return B150; case 200: return B200; case 300: return B300; case 600: return B600; case 1200: return B1200; case 1800: return B1800; case 2400: return B2400; case 4800: return B4800; case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; #ifdef B57600 case 57600: return B57600; #endif /* B57600 */ #ifdef B115200 case 115200: return B115200; #endif /* B115200 */ #ifdef B230400 case 230400: return B230400; #endif /* B230400 */ #ifdef B460800 case 460800: return B460800; #endif /* B460800 */ #ifdef B14400 case 14400: return B14400; #endif /* B14400 */ #ifdef B28800 case 28800: return B28800; #endif /* B28800 */ #ifdef B128000 /* dima */ case 128000: return B128000; #endif /* dima */ #ifdef B256000 /* dima */ case 256000: return B256000; #endif /* dima */ } /* Handle custom speeds */ if( speed >= 0 ) return speed; else { LEAVE( "RXTXPort:translate_speed: Error condition" ); return -1; } } -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 28 05:20:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 28 Jun 2005 07:20:21 -0400 Subject: [Rxtx] cross-compilation using Make for Mac Message-ID: Hi All, Please excuse the long post; Trent said: >" >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. " Here is what I have on the mac version: java -version java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) When I run: http://show.docjava.com:8086/book/cgij/code/jnlp/math.benchmarks.Dhry.jnlp I get: -- listing properties -- jnlpx.heapsize=NULL,NULL jnlpx.splashport=-1 java.runtime.name=Java(TM) 2 Runtime Environment, Stand... java.protocol.handler.pkgs=com.sun.javaws.net.protocol sun.boot.library.path=/System/Library/Frameworks/JavaVM.fra... java.vm.version=1.4.2-38 awt.nativeDoubleBuffering=true gopherProxySet=false http.auth.serializeRequests=true java.vm.vendor="Apple Computer, Inc." java.vendor.url=http://apple.com/ path.separator=: java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io jnlpx.home=/Applications/Utilities/Java/Java Web... user.country=US sun.os.patch.level=unknown java.vm.specification.name=Java Virtual Machine Specification user.dir=/ java.runtime.version=1.4.2_05-141.4 java.awt.graphicsenv=apple.awt.CGraphicsEnvironment java.endorsed.dirs=/System/Library/Frameworks/JavaVM.fra... os.arch=ppc java.io.tmpdir=/tmp line.separator= java.vm.specification.vendor=Sun Microsystems Inc. jnlpx.remove=false os.name=Mac OS X sun.java2d.fontpath= java.library.path=/Applications/Utilities/Java/Java Web... java.specification.name=Java Platform API Specification java.class.version=48.0 jnlpx.deployment.user.home=/Users/lyon/Library/Caches/Java Web S... java.util.prefs.PreferencesFactory=java.util.prefs.MacOSXPreferencesFactory os.version=10.3.9 user.home=/Users/lyon user.timezone=America/New_York java.security.policy=file:/Applications/Utilities/Java/Jav... java.awt.printerjob=apple.awt.CPrinterJob trustProxy=true java.specification.version=1.4 file.encoding=MacRoman jnlpx.deployment.system.home=/Applications/Utilities/Java/J2SE 5.0... user.name=lyon java.class.path=/Applications/Utilities/Java/Java Web... java.vm.specification.version=1.0 sun.arch.data.model=32 java.home=/System/Library/Frameworks/JavaVM.fra... java.specification.vendor=Sun Microsystems Inc. user.language=en awt.toolkit=apple.awt.CToolkit java.vm.info=mixed mode java.version=1.4.2_05 java.ext.dirs=/Users/lyon/Library/Java/Extensions:/... sun.boot.class.path=/System/Library/Frameworks/JavaVM.fra... java.vendor=Apple Computer, Inc. file.separator=/ java.vendor.url.bug=http://developer.apple.com/java/ sun.cpu.endian=big sun.io.unicode.encoding=UnicodeBig mrj.version=141.3 jnlpx.jvm=/System/Library/Frameworks/JavaVM.fra... sun.cpu.isalist= sun.awt.exception.handler=apple.awt.CToolkit$EventQueueExceptio... javawebstart.version=javaws-1.4.2_05 800 mhz g4,878k ds/sec total time: 1184ms Result: 844594 dhrystone/sec. Load average for last 15 minutes:0.62 So, I feel pretty sure that I have tried this with 1.4. As to modifying the RXTX compilation, that I did not do...and I take your point. I have been using the binary distributions as is. Oops. I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Now when I do a make, I get: make gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known libtool: link: warning: undefined symbols not allowed in i386-pc-mingw32 shared libraries rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ln: `SerialImp.o': File exists make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 So, I do a make clean, then a make: .... (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ar cru .libs/librxtxSerial.a /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o ar: /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o: No such file or directory make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 In the i386 directory, there is a symbolic link left from something: ls -al SerialImp.o lrwxrwxrwx 1 lyon lyon 12 Jun 28 07:03 SerialImp.o -> SerialImp.lo However, the SerialImp.lo is not present (which is the cause of the error, I think). On the other hand, the file I am looking for is present in: i686-pc-linux-gnu Possibly the i386 generation is not clean (of course it is also likely that I am just asking dumb questions, being a newbie to the code and all.). Finally, will this make file regenerate the distro for the mac? I found some really old (from year 2001) files in: cvs/MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions Which I could use for the distro...but I would prefer to do a clean, multi-platform build from make. Thanks! - Doug >On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > >> Hi All, >> I wrote: >> Jasmine: Is this working any better? >> >> And Jasmine says: >> Nope. >> >> An error occurred while launching/running the application. >> >> Title: addbk.JAddressBook.Main >> Vendor: DocJava, Inc. >> Category: Unexpected Error >> >> gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) >> >> > > I am using -source 1.3 and -target 1.3 >> for the compilation, however, we still seem to have this problem, >> which my machine (for some reason) does not have. >> Does anyone have any ideas about what might be the problem? >> > >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. > > >The suggested -source/target fix should avoid the problem. > >-- >Trent Jarvi >tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 28 09:43:41 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 28 Jun 2005 10:43:41 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: <42C1702D.1070307@atcorp.com> > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. There is ioctl stuff in the driver for the chip, but i haven't seen the TIOC*SERIAL entries. That might be why it continues to fail. I did get around the problem, though, by hacking the driver and just specifying the baud rate I need. Now everything works well. Thanks for all the assistance you've provided. ~ Shawn M. Lavelle From taj at www.linux.org.uk Tue Jun 28 12:42:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:42:29 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known Add a compiler flag -DWIN32 The code above should not be compiling on w32 as it is #if !defined(WIN32) You can look at the bottom of Makefile.in to see the w32 compile flags. Search for "WIN32 CrossCompiling from here down" If its still not working, I can set you up with the Bob account. Just email me off the list. W32 compiling is a bit complicated. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 28 12:52:50 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:52:50 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Nods. I did change configure but right now it is only in the baudbase/divisor patch I posted. I'm going to add several extension baud rates that can be supported by normal API calls and commit that today as a followup to my comments yesterday on baudrates. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Wed Jun 29 01:52:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 08:52:10 +0100 (BST) Subject: [Rxtx] [PATCH] More baud rate fixes Message-ID: I went through the native baudrate conversion from Java and added several. This patch is against CVS 2.1 head. I think thats it for baud rate fixes unless someone see something. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- A non-text attachment was scrubbed... Name: baud_base_and_divisor_plus_odd_baudrates.diff.gz Type: application/x-gzip Size: 3291 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050629/4c1ef1c2/baud_base_and_divisor_plus_odd_baudrates.diff-0398.gz From lyon at docjava.com Wed Jun 29 10:33:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 29 Jun 2005 12:33:45 -0400 Subject: [Rxtx] java.comm dependencies Message-ID: Hi All, During a build of the rxtx code, I have left the javax.comm out of the system (on purpose). However, I get an error, at run time: CommPortIdentifier:static initialization() apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: javax/comm/CommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver I am thinking that there is something in the gnu.io.CommPortIdentifier that seeks to load the javax.comm.CommDriver. It was my understanding that we could write code without reference to the javax.comm.CommDriver and that we could work in the gnu namespace. Is this true? Thanks! - Doug From taj at www.linux.org.uk Wed Jun 29 11:16:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 18:16:08 +0100 (BST) Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > During a build of the rxtx code, I have left the > javax.comm out of the system (on purpose). > However, I get an error, at run time: > > CommPortIdentifier:static initialization() > apple.awt.EventQueueExceptionHandler Caught Throwable : > java.lang.NoClassDefFoundError: javax/comm/CommDriver > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > that seeks to load the javax.comm.CommDriver. > > It was my understanding that we could write code without reference > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > Is this true? > Yes. People use 2.1 without javax all the time. There should be no reference to javax at all in rxtx 2.1. You may check your code. I just did a grep through 2.1 and there is nothing. You may look at the classes you are using. If you find javax.comm in your code, replace it with gnu.io and that should be all you need to do. -- Trent Jarvi tjarvi at qbang.org From jayant28k at gmail.com Wed Jun 29 21:49:28 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Thu, 30 Jun 2005 09:19:28 +0530 Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: <6a6a02310506292049778c452f@mail.gmail.com> Trent, I think best idea is to have wiki for rxtx code. So as the traffic is increasing with time. "RXTX" seems to be more popular in embbeded system. Sun Microsystems will always apperciate your efforts on parallel and serial ports commincation based application in IT Industry. Thanks for your help on this forum as "ONE MAN ARMY" ;-) Cheers, Jayant On 6/29/05, Trent Jarvi wrote: > On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > > > Hi All, > > During a build of the rxtx code, I have left the > > javax.comm out of the system (on purpose). > > However, I get an error, at run time: > > > > CommPortIdentifier:static initialization() > > apple.awt.EventQueueExceptionHandler Caught Throwable : > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > > that seeks to load the javax.comm.CommDriver. > > > > It was my understanding that we could write code without reference > > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > > > Is this true? > > > > Yes. People use 2.1 without javax all the time. > > There should be no reference to javax at all in rxtx 2.1. You may check > your code. I just did a grep through 2.1 and there is nothing. You may > look at the classes you are using. > > If you find javax.comm in your code, replace it with gnu.io and that > should be all you need to do. > > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From uwe at kubosch.no Sat Jun 25 02:50:24 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Sat, 25 Jun 2005 10:50:24 +0200 Subject: [Rxtx] RXTX in FC3/FC4 Message-ID: <1119689424.12606.14.camel@BPC0276> Hi all! I am trying to get RXTX to work on Fedora Core, version 3 or 4. I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext directory. I have edited the jre/lib/javax.comm.properties according to the docs. I have tried this with both rxtx 2.0 and 2.1. I have tried on two different machines. I have tried with java 1.4.2 and java 1.5.0, both from Sun. I always get a signall 11 from the native libraries when they are loaded. Is this a common problem? Any help is greatly appreciated. Below is the start of the error message. More can be supplied on demand. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x65015A Function=(null)+0x65015A Library=/lib/ld-linux.so.2 NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) - locked <0xed46f628> (a java.util.Vector) - locked <0xed471708> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xed46ebc0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.InitializeDriver(CommPortIdentifier.java:213) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:248) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:351) at com.jpeterson.x10.module.CM11A.allocate(CM11A.java:1160) at net.sourceforge.cruisecontrol.publishers.X10Publisher.send(X10Publisher.java:182) at net.sourceforge.cruisecontrol.publishers.X10Publisher.turnOff(X10Publisher.java:171) at net.sourceforge.cruisecontrol.publishers.X10Publisher.handleBuild(X10Publisher.java:148) at net.sourceforge.cruisecontrol.publishers.X10Publisher.publish(X10Publisher.java:141) at net.sourceforge.cruisecontrol.Project.publish(Project.java:679) at net.sourceforge.cruisecontrol.Project.build(Project.java:227) at net.sourceforge.cruisecontrol.Project.execute(Project.java:153) at net.sourceforge.cruisecontrol.ProjectWrapper.run(ProjectWrapper.java:66) at java.lang.Thread.run(Thread.java:534) From chris_jh at blueyonder.co.uk Tue Jun 28 05:37:10 2005 From: chris_jh at blueyonder.co.uk (Christopher Harris) Date: Tue, 28 Jun 2005 12:37:10 +0100 Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError Message-ID: <42C13666.9030108@blueyonder.co.uk> Hi I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 32bit) The serial ports work fine with no issues, but when i try to use the parallel port i get this message Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:66) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) I am trying to print a line out to port "/dev/lp0" At first i thought it could not find the librxtxParallel.so file, but when i renamed it i got a different saying it could not find the library. I have tried to run as root no difference. It is really weird, i get no compile errors and the serial ports work fine. I changed the LPRPort.java and commented out the Initialize call method. And just get the same error but for the method open. It is as though it can't see the methods, and yet it can see the library. I did have a bit of check of the JNI implementation in rxtx but could not spot anything. Yours Thankfully Christopher Harris From lyon at docjava.com Thu Jun 30 02:28:09 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 04:28:09 -0400 Subject: [Rxtx] tools Message-ID: Hi All, I have been thinking about automatic cross-platform native method development of Java/C programs. It appears that different binary tools are needed to target different platforms. Configuration seems a bit painful. Is there something better available than make? Is ANT any good at this? Has anyone tried: http://jnipp.sourceforge.net/ Thanks! - Doug From lyon at docjava.com Thu Jun 30 04:11:17 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 06:11:17 -0400 Subject: [Rxtx] javax.comm Message-ID: Hi All, When I load my jar files on a linux box, all is well. However, when I load them on a mac, I get: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver The jar files for the mac are different from the jar files for linux, because recompilation of the native code for the mac has not been easy, for me. As a result, the RXTX jars are tending toward specific versions and platforms. Probably, this is not an ideal situation, but, I suspect, it is common. I have an idea that we could create a single JNLP distro site that we can make reference to that would enable a uniform repository of synchronized signed native methods and jars for RXTX. For example, the one-wire Maxim folks have a real-nice approach where their stuff makes reference to another JNLP file that contains all the stuff we need to make RXTX work. Check it out at: http://www.maxim-ic.com/products/ibutton/software/1wire/OneWireViewer.cfm However, even they have problems on an unconfigured machine: Specified adapter name "DS9097U" is not known * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cannot load default adapter. Please check that the adapter is connected and that no other application is using the port. If you have checked the adapter, the default port might not be selected. Either set the value of the TMEX default using the utility provided with the TMEX Runtime, or create a new file in the /lib folder called onewireviewer.properties with two lines, similar to the following: #native win32 drivers adapter.name={DS9097U} adapter.port=COM1 #or javax.comm drivers adapter.name=DS9097U adapter.port=COM1 The full path to this file should be: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/onewireviewer.properties ---- Wow, that is a show stopper! Configuration is something that we really need to think about as an automatic thing, particularly for web start users. You can't ask a person who wants to run an application to figure out how to alter a properties file. If you know you need one, then get permission and make one...automatically. That makes a lot of sense, to me. Basically, we need an installer. At the very least, all the pre-built binaries and jars needed for the RXTX package on several platforms should be available from a single place. One this happens, we can make a JNLP file that is platform specific, but can give us a level of indirection. Is this something that has been done already? Thanks! - Doug From taj at www.linux.org.uk Thu Jun 30 08:10:22 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 15:10:22 +0100 (BST) Subject: [Rxtx] tools In-Reply-To: References: Message-ID: On Thu, 30 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I have been thinking about automatic cross-platform > native method development of Java/C programs. > > It appears that different binary tools are needed to target different > platforms. Configuration seems a bit painful. > > Is there something better available than make? > > Is ANT any good at this? I'm far from an Ant expert but have used it for other projects. The main problem I see with ant is there is no mainstream support for platform neutral neutral library creation as far as I can tell. I think ant is a fine replacement for make but I've not seen a suitable replacement for autoconf. At that point, make is as good as anything. It should be possible to create a ant build.xml that works on say Solaris, Linux, Windows and Mac OS X. The problem is when you are trying to build a library for embeded ARM from Mac OS X. > Has anyone tried: > http://jnipp.sourceforge.net/ -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:22:02 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:22:02 +0100 (BST) Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <1119689424.12606.14.camel@BPC0276> References: <1119689424.12606.14.camel@BPC0276> Message-ID: On Sat, 25 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I am trying to get RXTX to work on Fedora Core, version 3 or 4. > > I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 > directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext > directory. > > I have edited the jre/lib/javax.comm.properties according to the docs. > > I have tried this with both rxtx 2.0 and 2.1. > > I have tried on two different machines. > > I have tried with java 1.4.2 and java 1.5.0, both from Sun. > > I always get a signall 11 from the native libraries when they are > loaded. Is this a common problem? Any help is greatly appreciated. > Below is the start of the error message. More can be supplied on > demand. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x65015A > Function=(null)+0x65015A > Library=/lib/ld-linux.so.2 > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) If you compile rxtx from source, this will probably go away. I'm not sure what the exact cause is but it looks like the binaries are not suitable for FC3/4. The ABI may have changed since those had been compiled. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:26:56 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:26:56 +0100 (BST) Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError In-Reply-To: <42C13666.9030108@blueyonder.co.uk> References: <42C13666.9030108@blueyonder.co.uk> Message-ID: tOn Tue, 28 Jun 2005, Christopher Harris wrote: > Hi > > I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 > 32bit) > > The serial ports work fine with no issues, but when i try to use the > parallel port i get this message > > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:66) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) > > > I am trying to print a line out to port "/dev/lp0" > > At first i thought it could not find the librxtxParallel.so file, but > when i renamed it i got a different saying it could not find the library. > > I have tried to run as root no difference. > > It is really weird, i get no compile errors and the serial ports work fine. > > I changed the LPRPort.java and commented out the Initialize call method. > And just get the same error but for the method open. > > It is as though it can't see the methods, and yet it can see the library. > I did have a bit of check of the JNI implementation in rxtx but could > not spot anything. > > > You can check if the symbols are in the shared library: nm librxtxSerial.so |grep Initialize If the symbols are not there, there was a build error. Watch very close for build errors while compiling from source. I suspect something isnt behaving right. -- Trent Jarvi tjarvi at qbang.org From allen at adbyrne.us Thu Jun 30 06:55:58 2005 From: allen at adbyrne.us (Allen Byrne) Date: Thu, 30 Jun 2005 07:55:58 -0500 Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> References: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> Message-ID: <200506300755.59159.allen@adbyrne.us> On Thursday 30 June 2005 00:31, rxtx-request at mail.electronpusher.org wrote: > >Message: 8 >Date: Sat, 25 Jun 2005 10:50:24 +0200 >From: Uwe Kubosch >Subject: [Rxtx] RXTX in FC3/FC4 >To: rxtx at mail.electronpusher.org >Message-ID: <1119689424.12606.14.camel at BPC0276> >Content-Type: text/plain > >Hi all! > >I am trying to get RXTX to work on Fedora Core, version 3 or 4. > >I have tried this with both rxtx 2.0 and 2.1. > >I have tried on two different machines. > >I have tried with java 1.4.2 and java 1.5.0, both from Sun. > >I always get a signall 11 from the native libraries when they are >loaded. ?Is this a common problem? ?Any help is greatly appreciated. >Below is the start of the error message. ?More can be supplied on >demand. > >An unexpected exception has been detected in native code outside the VM. >Unexpected Signal : 11 occurred at PC=0x65015A >Function=(null)+0x65015A >Library=/lib/ld-linux.so.2 > I had thi same problem on SUSE9.3 and java 1.5.0. After searching through the archives, I found a patch that required adding a sleep(1000) command in two functions of SerialIO.java. This only was for rxtx2.1, I had no trouble with rxtx2.0. Note, also I had to add the "|1.5*" sequence to the configure.in file to get good *.so libs. Again 2.0 was fine. -- Allen Byrne adbyrne at ieee.org http://modelrr.adbyrne.us From taj at www.linux.org.uk Fri Jun 3 01:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 08:57:29 +0100 (BST) Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 3 09:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 16:57:53 +0100 (BST) Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi at qbang.org From jasmine at electronpusher.org Fri Jun 3 10:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 17:12:21 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 11:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:02:09 +0100 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 11:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:05:10 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From jon.nall at gmail.com Mon Jun 6 09:13:58 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 10:13:58 -0500 Subject: [Rxtx] StackOverflowError Message-ID: I have a fairly small application that is communicating to a microcontroller programmer at 115.2k. I have a test where I try and dump the memory of the microcontroller (whose size is 8k and change). Things are going smoothly and the data looks good. Then after reading out ~6.5k of data, I get a StackOverflowError. The stack trace looks like: CommInterface.serialEvent(): 324 // this is my code RXTXPort.sendEvent(): 732 RXTXPort.eventLoop() [Native] MonitorThread.run(): 1531 I am running on windows and using rxtx-2.1-CVS-20050120. When I increased the stack size to 512k, I could read the entire chip without issue. But that doesn't seem like the right thing to do without root causing what's happening. My code doesn't include any recursion and the stack trace looks terribly short, so I'm a bit confused as to why I'm getting a StackOverflowError. CommInterface.serialEvent() does little more than grab the available bytes, enter a synchronized block, stick them in a common data area for the main thread to use and leave the synchronization block. I guess my question is: are there any known issues with the default stack size when using the latest rxtx on windows? thanks, nall. From taj at www.linux.org.uk Mon Jun 6 09:27:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 16:27:34 +0100 (BST) Subject: [Rxtx] StackOverflowError In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > I have a fairly small application that is communicating to a > microcontroller programmer at 115.2k. I have a test where I try and > dump the memory of the microcontroller (whose size is 8k and change). > Things are going smoothly and the data looks good. Then after reading > out ~6.5k of data, I get a StackOverflowError. The stack trace looks > like: > > CommInterface.serialEvent(): 324 // this is my code > RXTXPort.sendEvent(): 732 > RXTXPort.eventLoop() [Native] > MonitorThread.run(): 1531 > > I am running on windows and using rxtx-2.1-CVS-20050120. When I > increased the stack size to 512k, I could read the entire chip without > issue. But that doesn't seem like the right thing to do without root > causing what's happening. My code doesn't include any recursion and > the stack trace looks terribly short, so I'm a bit confused as to why > I'm getting a StackOverflowError. > > CommInterface.serialEvent() does little more than grab the available > bytes, enter a synchronized block, stick them in a common data area > for the main thread to use and leave the synchronization block. > > I guess my question is: are there any known issues with the default > stack size when using the latest rxtx on windows? > This is the first I've heard of the problem. It is strange as you mention lookin at the stack trace. That cant be taking up too much space. If you just toss the data instead of trying to put it in your work area, does it persist? -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Mon Jun 6 10:09:39 2005 From: lengyel at gmail.com (FL) Date: Mon, 6 Jun 2005 12:09:39 -0400 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on which the jdk1.5.0_03 is installed. I found that the INSTALL documentation seems to be in error. It states that javacomm20-x86.tar.Z (the Java Communications API for Solaris/x86) must be used, in fact this choice led to the following test with theBlackBox sample program in the commapi: root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG BlackBox -p /dev/ttyS0 Port /dev/ttyS0 not found! No serial ports found! Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to cause Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to the Eclipse stable build version 3.1M7 to avoid this. However, I found that using the Solaris/Sparc version of commapi worked on my system. I have documented this on: http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050606/b28fb9a7/attachment-0399.html From taj at www.linux.org.uk Mon Jun 6 10:30:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:30:27 +0100 (BST) Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, FL wrote: > I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on > which the jdk1.5.0_03 is installed. I found that the INSTALL documentation > seems to be in error. It states that javacomm20-x86.tar.Z (the Java > Communications API for Solaris/x86) must be used, in fact this choice led to > the following test with theBlackBox sample program in the commapi: > > root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG > BlackBox -p /dev/ttyS0 > Port /dev/ttyS0 not found! > No serial ports found! > > Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to > cause > Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to > the Eclipse stable build version 3.1M7 to avoid this. > > However, I found that using the Solaris/Sparc version of commapi > worked on my system. > > I have documented this on: > > http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 > Thanks FL. I'll change the documentation to point to the SPARC comm.jar. In the past, any Solaris was good enough, we tried to avoid the w32 comm.jar because it made native calls rxtx would never implement on any OS as they are not platform neutral. I'll withold comments about Sun's comm.jar being different on various CPUs within even the same OS. RXTX 2.1 does not need to do that even acrossed OSs for instance. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 6 10:35:43 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 11:35:43 -0500 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API Message-ID: It seems that Sun's javax.comm site does not include JavaDoc'ed API and the RxTx site has the API, but no real documentation. Is there some site that i'm just missing in my google searches? I'm looking for a copy of the javax.comm API which is documented. Thanks, nall. From taj at www.linux.org.uk Mon Jun 6 10:44:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:44:03 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > It seems that Sun's javax.comm site does not include JavaDoc'ed API > and the RxTx site has the API, but no real documentation. Is there > some site that i'm just missing in my google searches? I'm looking for > a copy of the javax.comm API which is documented. > > Thanks, > nall. Sun's version is with their binary downloads. RXTX tries to match that so I never bothered with more complete JavaDocs. Whatever Sun documents is what we try to do. -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Mon Jun 6 12:13:44 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 6 Jun 2005 14:13:44 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: Message-ID: <20050606181245.528C929D56F@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Trent Jarvi > Sent: Monday, June 06, 2005 12:44 PM > To: Jon Nall; Java RXTX discussion > Subject: Re: [Rxtx] Where can I find JavaDoc on the javax.comm API > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > It seems that Sun's javax.comm site does not include JavaDoc'ed API > > and the RxTx site has the API, but no real documentation. Is there > > some site that i'm just missing in my google searches? I'm > looking for > > a copy of the javax.comm API which is documented. > > > > Thanks, > > nall. > > Sun's version is with their binary downloads. RXTX tries to > match that so I never bothered with more complete JavaDocs. > Whatever Sun documents is what we try to do. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Try http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht ml -Ack From gadelavega at yahoo.com.ar Mon Jun 6 12:58:09 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Mon, 6 Jun 2005 15:58:09 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606181245.528C929D56F@mail.electronpusher.org> Message-ID: <20050606185809.57069.qmail@web14603.mail.yahoo.com> --- "David S. Acker" escribi?: > > -----Original Message----- > > From: rxtx-bounces at mail.electronpusher.org > > [mailto:rxtx-bounces at mail.electronpusher.org] On > Behalf Of Trent Jarvi > > Sent: Monday, June 06, 2005 12:44 PM > > To: Jon Nall; Java RXTX discussion > > Subject: Re: [Rxtx] Where can I find JavaDoc on > the javax.comm API > > > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > > > It seems that Sun's javax.comm site does not > include JavaDoc'ed API > > > and the RxTx site has the API, but no real > documentation. Is there > > > some site that i'm just missing in my google > searches? I'm > > looking for > > > a copy of the javax.comm API which is > documented. > > > > > > Thanks, > > > nall. > > > > Sun's version is with their binary downloads. > RXTX tries to > > match that so I never bothered with more complete > JavaDocs. > > Whatever Sun documents is what we try to do. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > Try > http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > ml > -Ack > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > I'm prety sure it was there... but not anymore. Gonzalo A. de la Vega, BI ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From taj at www.linux.org.uk Mon Jun 6 18:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 01:09:14 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606185809.57069.qmail@web14603.mail.yahoo.com> References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: >> http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > > I'm prety sure it was there... but not anymore. > It is there. Maybe the URL got mangled. Try this http://tinyurl.com/8dfp7 It just redirects you to: http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.html -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 7 05:46:39 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Jun 2005 07:46:39 -0400 Subject: [Rxtx] rxtx under fedora - odd procedures Message-ID: Hi All, I was able to get RXTX communications to work under Fedora, but only after I added myself to the UUCP and LOCK groups, logged out and then logged back in. Both groups appear to be needed in order to access the serial ports. Also the group alter did not take until after I logged out and logged back in. My theory is that you need permission to write to the var/spool directory under fedora and that this is the only way to do it. Logging out and logging back in just seems like an odd thing to do. I suppose some users may have to restart X. Ouch! Is this true? The alter_group command indicates that you need to be an su to alter the group database. Does this mean that my serial port users need a database su able person to use serial port applications under RXTX? If so, what is the procedure to make a transparent install work using Java web start? Should I be prompting users for the su password? Should I be telling users to exit from X and log out? Is this the way other serial communications programs work? Thanks! - Doug From sean_montgomery at baseview.com Tue Jun 7 08:14:51 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 7 Jun 2005 10:14:51 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: >>> http://java.sun.com/products/javacomm/javadocs/javax/comm/package- >>> summary.ht >>> > > >> >> I'm prety sure it was there... but not anymore. >> >> > > It is there. Maybe the URL got mangled. Try this > > http://tinyurl.com/8dfp7 > > It just redirects you to: > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > summary.html > Maybe the issue here is that the info is available without frames from that URL, but when you try to access it with frames (from the link on that page) it doesn't work - it takes you to: http://java.sun.com/products/javacomm/javadocs/index.html Which doesn't have anything useful on it. From gadelavega at yahoo.com.ar Tue Jun 7 08:22:50 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:22:50 -0300 (ART) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: Message-ID: <20050607142251.92850.qmail@web14626.mail.yahoo.com> --- "Dr. Douglas Lyon" escribi?: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the > group > alter did not take until after I logged out and > logged back in. > > My theory is that you need permission to write to > the var/spool > directory under fedora and that this is the only way > to do it. > > Logging out and logging back in just seems like an > odd thing to > do. I suppose some users may have to restart X. > Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port > applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log > out? > Is this the way other serial communications programs > work? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Actually, you need the lock group to acces /var/lock directory, and uucp to acces /dev/ttyS*. You (as root) shuold add all users you will allow to use the serial ports to group uucp and all the ones you'll allow to lock the ports to lock group (rxtx needs both). This is not only for rxtx, but for any use of the serial ports. Next time they login they'll be able to work, so if they are in they'll have to log out first. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From gadelavega at yahoo.com.ar Tue Jun 7 08:23:56 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:23:56 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> Message-ID: <20050607142356.93815.qmail@web14624.mail.yahoo.com> --- Sean Montgomery escribi?: > > On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: > > >>> > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > >>> summary.ht > >>> > > > > > >> > >> I'm prety sure it was there... but not anymore. > >> > >> > > > > It is there. Maybe the URL got mangled. Try this > > > > http://tinyurl.com/8dfp7 > > > > It just redirects you to: > > > > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > > summary.html > > > > Maybe the issue here is that the info is available > without frames > from that URL, but when you try to access it with > frames (from the > link on that page) it doesn't work - it takes you > to: > > http://java.sun.com/products/javacomm/javadocs/index.html > > Which doesn't have anything useful on it. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > That's right, my bad. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From jon.nall at gmail.com Tue Jun 7 08:33:40 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 09:33:40 -0500 Subject: [Rxtx] performance expectations Message-ID: Hi all. I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC microcontroller. The protocol I'm using (which I didn't create) looks like this for the section of code I'm concerned with: PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data PIC -> PC: 0x01 // ACK 0xNN // First 8 bits of data 0xMM // Second 8 bits of data I issue ~2000 of these Read commands. The PIC itself has an input fifo which can store 18 bytes, so I can have 18 read commands in flight at a given time. The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k 8N1. I am measuring the time it takes to perform these 2000 commands at around 30 seconds, which is much longer than I anticipated. With the link fully utilized, I expected: Time per byte transmitted: 115200 / 8 = 14400 bytes/second = ~70 uS/byte Time per response transmitted: ~70 uS/byte * 3 bytes/response = ~210 uS/response Time for 2000 responses to be transmitted: ~210 uS/response * 2000 responses = ~420ms I'm a bit new to this, so I may have made some bad asumptions, but I would have expected a time of a couple of seconds to perform the 2000 reads, not 30+ seconds. I'm obviously missing something here. Can someone help me understand what's going on? Thanks, nall. From taj at www.linux.org.uk Tue Jun 7 09:17:48 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:17:48 +0100 (BST) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the group > alter did not take until after I logged out and logged back in. > > My theory is that you need permission to write to the var/spool > directory under fedora and that this is the only way to do it. > > Logging out and logging back in just seems like an odd thing to > do. I suppose some users may have to restart X. Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log out? > Is this the way other serial communications programs work? > RIght now, rxtx requires you do one of two things. 1) Use lock files (recommended). This requires intervention by the root users to allow users to create lock files and open the ports as you note. 2) configure rxtx with --disable-lockfiles. In this case you need only worry about the permissions on /dev/ttyS* I'm not sure what the default on Fedora is with respect to permisions. This is not very attractive. There is a better way it could be done on Fedora. Fedora comes with lockdev library. I've been considering this for some time. We could use that for the locking and do away with many of the problems. The problem is embeded devices running Linux do not come with liblockdev. But for your use, I would consider adding a new option for locking serial devices using liblockdev. lockdev-devel has a man page with further information. SYNOPSIS #include pid_t dev_testlock( const char * devname); pid_t dev_lock( const char * devname); pid_t dev_relock( const char * devname, pid_t pid); pid_t dev_unlock( const char * devname, pid_t pid); cc [ flag ... ] file ... -llockdev [ library ] This would probably need to be a configure time option to prevent problems on embeded Linux devices but could otherwise be the default on Linux. I could toss a quick patch together if this is confusing. It is actually easier than what rxtx does now. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 09:27:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:27:11 +0100 (BST) Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > Hi all. > I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC > microcontroller. The protocol I'm using (which I didn't create) looks like this > for the section of code I'm concerned with: > > PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data > PIC -> PC: 0x01 // ACK > 0xNN // First 8 bits of data > 0xMM // Second 8 bits of data > > I issue ~2000 of these Read commands. The PIC itself has an input fifo which > can store 18 bytes, so I can have 18 read commands in flight at a given time. > The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k > 8N1. > > I am measuring the time it takes to perform these 2000 commands at around 30 > seconds, which is much longer than I anticipated. With the link fully utilized, > I expected: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte > > Time per response transmitted: > ~70 uS/byte * 3 bytes/response = ~210 uS/response > > Time for 2000 responses to be transmitted: > ~210 uS/response * 2000 responses = ~420ms > > I'm a bit new to this, so I may have made some bad asumptions, but I would have > expected a time of a couple of seconds to perform the 2000 reads, not 30+ > seconds. > > I'm obviously missing something here. Can someone help me understand what's > going on? > I've hooked rxtx in loopback with a scope in the past at 9600 baud (baud rate is not important). Using event notification and just writing a byte on event/read the latencey was around 8-12 ms. The JNI is not an efficient way to use native code - especially for bit banging. So if timing is critical you want to move some of the logic into the native code rather than banging over the JNI. 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your performance. C# has advantages here. If you move your logic into the native layer or use gcj (rxtx will work with that too) most of your latency should vanish. You may have to play with some sleeps in eventLoop at that point to get full native efficiency. With gcj all of rxtx becomes 'native code' as java is just treated as a subset of C++. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 09:38:51 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 10:38:51 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: On 6/7/05, Jon Nall wrote: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte of course that should be divided by 10 to account for the start/stop bits, but it barely changes the end results. From carobizar at free.fr Tue Jun 7 10:21:29 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 7 Jun 2005 18:21:29 +0200 Subject: [Rxtx] (no subject) Message-ID: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Hello ! I am a french student and I have to create an application able to read and write on serial and parallel port and to run on Windows and Linux. For the moment my program run on Windows thanks the Java Communication API (version for Microsoft Windows and Solaris/x86). But it doesn't work on Linux. Does a recent version of an installation documentation exist ? I didn't find one on the RXTX site (nothing for the windows installation and the linux installation deals with a "jcl.jar" that I don't know...). So, I have some questions : 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 version or Linux&w32 version ?) What are the differences between them ? Which of them are the most stable ? 2) Where have I to put the .so and .dll files ? 3) What have I to write on the file javax.comm.properties ? 4) Have I to delete the file win32comm.dll included in the Java Comm API ? 5) Have I to keep both comm.jar and RXTXcomm.jar ? Best regards, Caroline. From debief at telemsa.com Tue Jun 7 10:44:56 2005 From: debief at telemsa.com (DEBIEF Eric) Date: Tue, 7 Jun 2005 18:44:56 +0200 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: <200506071844.56656.debief@telemsa.com> Hi, We are "pushing" RxTx /Java here in a half-duplex link. The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC and application handling) about 25?s/byte. The figures are the barely the same on two environments. Environment 1 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Linux 2.6.3, Mdk 10.0. RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : bytes are lost on the wire. I need to investigate this mystery.... Java : 1.4.2-rc1 Blackdown Environment 2 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Windows 2000 Pro RxTx : 2.0.7. Java : 1.4.2_08 SUN I Hope this help, Eric. _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 7 11:05:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:05:45 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, DEBIEF Eric wrote: > Hi, > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. How many write() calls is this? > > Environment 1 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Linux 2.6.3, Mdk 10.0. > RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : > bytes are lost on the wire. I need to investigate this mystery.... > Java : 1.4.2-rc1 Blackdown > > Environment 2 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Windows 2000 Pro > RxTx : 2.0.7. > Java : 1.4.2_08 SUN > In my event/read/write test I found windows was ~20% faster than linux for some reason (strange part is Windows was in VMWare on the same Linux machine). It was about the same rxtx version. There are many problems with rxtx 1.4 with respect to commapi on windows but its code paths are more simple. What some people want from rxtx is perhaps better served by hacking up the very first release as they just want to read and write which is what rxtx was before Sun released commapi. It sounds like perhaps you are pushing out larger writes which will greatly improve results. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 11:16:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:16:49 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118161289.42a5c989cf6a2@imp4-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: On Tue, 7 Jun 2005 carobizar at free.fr wrote: > > Hello ! > > I am a french student and I have to create an application able to read and write > on serial and parallel port and to run on Windows and Linux. > For the moment my program run on Windows thanks the Java Communication API > (version for Microsoft Windows and Solaris/x86). > But it doesn't work on Linux. > > Does a recent version of an installation documentation exist ? > I didn't find one on the RXTX site (nothing for the windows installation and the > linux installation deals with a "jcl.jar" that I don't know...). > > So, I have some questions : > > 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 > version or Linux&w32 version ?) What are the differences between them ? Which > of them are the most stable ? > Use rxtx 2.0 with commapi for sparc solaris from Sun. If you want your current package javax.comm. > 2) Where have I to put the .so and .dll files ? On Linux just use the source, the configure script will do all of that for you. tar -xzvf rxtx-2.0-version mkdir rxtx-2.0-version/build cd rxtx-2.0-version/build ../configure && make install It will do everything for you. With Windows, you need to create the javax.comm.properties and install the DLL on your path. But you can just use Sun's package too. They are intended to be interchangable. > > 3) What have I to write on the file javax.comm.properties ? Driver=gnu.io.RXTXCommDriver More documentation in INSTALL that comes with the source. Sun's documentation should work too. configure does this for you on Linux. > > 4) Have I to delete the file win32comm.dll included in the Java Comm API ? > No > 5) Have I to keep both comm.jar and RXTXcomm.jar ? > Yes. RXTX 2.1 replaces comm.jar but the package is different (gnu.io) to avoid contaminating Sun's namespace. With rxtx 2.0 you need Sun's comm.jar - they work together. > > Best regards, > Caroline. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Tue Jun 7 12:07:34 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 14:07:34 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 Message-ID: <20050607180632.1543A29D5C8@mail.electronpusher.org> Hello, I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our product includes a built in USB to Serial adapter so that when it is connected to your PC over USB, it appears as a serial port. We had problems with Sun's comm library because it did not detect serial ports coming and going properly. I did run into a few issues with RxTx though. I am building under Windows (we support XP and 2000) under cygwin. I used a simple make file for the c code that works under cygwin and ant to build the java stuff. Attached is a diff file. The patches hit the following issues: ParallelImp.c - I am not using config so there is no config.h for me. Also, gcc didn't like a local file (win32termios.h) getting included with <> . RXTXPort.java - You can get an exception during the writeByte, writeArray, nativeDrain, readByte, read, readArray, readTerminatedArray, and nativeAvailable calls. Without this patch the IOLocked count gets stuck incremented. termios.c - If you try to open a port through CreateFile and get ERROR_ACCESS_DENIED it means someone else is using the port. We need to make sure to use serial_close instead of just close. I found that some devices finish their I/O synchronously. The code was treating this as an error. I also added some checking on the ClearError calls. I found a compile error when debugging is turned on (see the usleep change). SerialImp.c - Again, I don't have a config.h and again we must use quotes and not <> to include win32termios.h . I also commented out a report call since it seems to happen constantly on my system. Feel free to use these in any way that you want or just to ignore them. Thanks! -Dave Acker dacker at nomadio.net Software Engineer Nomadio, Inc. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diffs.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/5671d159/diffs-0396.txt From jon.nall at gmail.com Tue Jun 7 12:28:16 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 13:28:16 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, DEBIEF Eric wrote: > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. Hi. This is helpful, thanks. I can think of 2 reasons I'm not collecting the data as fast as I think I should be: 1) the device to PC connection is not at 100% utilization 2) my SerialPortEventListener processing has too much overhead Are there other explanations I might be missing as to why it takes so long to transfer the data? Thanks. nall. From taj at www.linux.org.uk Tue Jun 7 13:21:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:21:46 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > On 6/7/05, DEBIEF Eric wrote: > > We are "pushing" RxTx /Java here in a half-duplex link. > > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > > and application handling) about 25?s/byte. > > The figures are the barely the same on two environments. > > Hi. > This is helpful, thanks. I can think of 2 reasons I'm not collecting > the data as fast as I think I should be: > 1) the device to PC connection is not at 100% utilization > 2) my SerialPortEventListener processing has too much overhead > > Are there other explanations I might be missing as to why it takes so > long to transfer the data? > Polling the port would probably make more sense. You can set the threshold/timeouts to avoid racing and not deal with the event notification. As mentioned earlier I think the event latency is ~10ms. Keep the event listener around, rxtx 2.* does not close well without it. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 13:27:27 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 14:27:27 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, Trent Jarvi wrote: > Polling the port would probably make more sense. You can set the > threshold/timeouts to avoid racing and not deal with the event > notification. As mentioned earlier I think the event latency is ~10ms. Trent, Thanks for the response. Just to make sure I understand what you're talking about, when you say event latency, do you mean the time it takes from when the byte hits the PC's comm port to when rxtx presents it to user code? So if the link is 100% utilized, will my user code see "hiccups" or a steady stream of data? Thanks for helping a serial port newbie. nall. From dacker at nomadio.net Tue Jun 7 13:32:20 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 15:32:20 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <20050607193118.5499329CAA0@mail.electronpusher.org> Some folks asked about the make file and ant steps. I have JAVA_HOME set as follows: $ echo $JAVA_HOME C:\Program Files\Java\jdk1.5.0_01 I have all the code in rxtx/src put into gnu/io . The make file here doesn't have optimizations turned on. We have not tested with it yet. --------------Begin Makefile------------------ CPPFLAGS="-I$(JAVA_HOME)/include" "-I$(JAVA_HOME)/include/win32" SOBJECTS=SerialImp.o fuserImp.o termios.o fixup.o init.o POBJECTS=ParallelImp.o termios.o init.o DLLS=rxtxParallel.dll rxtxSerial.dll all: $(CLASSES) $(DLLS) rxtxSerial.dll: $(SOBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(SOBJECTS) rxtxParallel.dll: $(POBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(POBJECTS) clean: rm -fv $(SOBJECTS) $(POBJECTS) $(DLLS) %.o: %.c gcc -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< %.o: %.cpp g++ -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< --------------End Makefile------------------ Here is the ant target I use to build the rxtx libs. Our build puts the class files in a bin dir. We copy the dlls to a deploy dir and to the build dir. Eclipse seems to like the dlls in the build dir. The deploy dir is used when we build our full package. --------------Begin Ant Section------------------ --------------End Ant Section------------------ > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > David S. Acker > Sent: Tuesday, June 07, 2005 2:08 PM > To: 'Java RXTX discussion' > Subject: [Rxtx] Patches to 2.1-7pre17 > > Hello, > I am using RxTx with the Nomadio Sensor, > http://www.nomadio.net/ . Our product includes a built in > USB to Serial adapter so that when it is connected to your PC > over USB, it appears as a serial port. We had problems with > Sun's comm library because it did not detect serial ports > coming and going properly. > > I did run into a few issues with RxTx though. I am building > under Windows (we support XP and 2000) under cygwin. I used > a simple make file for the c code that works under cygwin and > ant to build the java stuff. Attached is a diff file. The > patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h > for me. Also, gcc didn't like a local file (win32termios.h) > getting included with <> . > > RXTXPort.java - You can get an exception during the > writeByte, writeArray, nativeDrain, readByte, read, > readArray, readTerminatedArray, and nativeAvailable calls. > Without this patch the IOLocked count gets stuck incremented. > > termios.c - If you try to open a port through CreateFile and > get ERROR_ACCESS_DENIED it means someone else is using the > port. We need to make sure to use serial_close instead of > just close. I found that some devices finish their I/O > synchronously. The code was treating this as an error. I > also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we > must use quotes and not <> to include win32termios.h . I > also commented out a report call since it seems to happen > constantly on my system. > > Feel free to use these in any way that you want or just to > ignore them. > Thanks! > > -Dave Acker > dacker at nomadio.net > Software Engineer > Nomadio, Inc. > From taj at www.linux.org.uk Tue Jun 7 13:37:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:37:45 +0100 (BST) Subject: [Rxtx] Re: Stack Smashing Attack In-Reply-To: <200506072012.48860.ferdinand.tatzig@web.de> References: <200506072012.48860.ferdinand.tatzig@web.de> Message-ID: On Tue, 7 Jun 2005, Ferdinand Tatzig wrote: > Dear Trent > > I am using RXTX for serial port communication between a PC and a payment > transaction terminal. > When I run my application under Windows 2000, an i386-Linux or an i386-FreeBSD > it works as I expect it to do. However, when I start it to run on AMD64 > machine with a 64-bit Gentoo Linux, the VM terminates with the following > error: > > Port found: /dev/ttyS0 > java: stack smashing attack in function configure_port() > > I am using a 64-bit Blackdown-1.4.2-01 VM. > > I have searched the internet but have found no information about this error. > > This is the code of the method which initializes the serial port: > > /** > * initializes a serial port for communication with a terminal; only > * accessible within this class > * > * @param communication > * @param serialPortToBeInitialized > * @param tillInterfaceEventListener > */ > private TillInterfaceSerialPort(Communication communication, > String serialPortToBeInitialized, > TillInterfaceEventListener tillInterfaceEventListener) > throws IOException, PortInUseException, > TillInterfaceSerialPortNotFoundException, > TooManyListenersException, UnsupportedCommOperationException { > serialPortName = "not initialized yet"; > CommPortIdentifier portId = null; > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > boolean portFound = false; > String temporarySerialPortName = "not initialized yet"; > > // look for a serial port > while (portList.hasMoreElements() && !portFound) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > temporarySerialPortName = portId.getName(); > if (temporarySerialPortName.equals(serialPortToBeInitialized)) { > System.out.print("Port found: "); > System.out.println(temporarySerialPortName); > serialPortName = temporarySerialPortName; > portFound = true; > } > } > } > if (portFound) { > > // initialize the found port - this command causes the VM to terminate > serialPort = (SerialPort) portId > .open( > TillInterfaceConstants.APPLICATION_NAME, > TillInterfaceConstants > .TIMEOUT_IN_MILLISECONDS_FOR_OPENING_OF_COMMUNICATION_PORT); > > // add an event listener which listens > // on the serial port and notifies the > // serial port object when input bytes > // have been received at the port > serialPort.addEventListener(tillInterfaceEventListener); > serialPort.notifyOnDataAvailable(true); > > // initialize the physical layer > // parameters of the serial port > serialPort.setSerialPortParams(TillInterfaceConstants.BAUD_RATE, > SerialPort.DATABITS_8, SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > // set the inter-character > // timeout (T2) > serialPort > .enableReceiveTimeout(TillInterfaceConstants.INTERCHARACTER_TIMEOUT_IN_MILLISECONDS); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > } else > throw new TillInterfaceSerialPortNotFoundException(); > } > > Any hint to solve this problem would be kindly appreciated. > The only thing that comes to mind here after looking at the offending function is rxtx used to include asm/termios.h but now we moved to termios.h and had glibc fix their headers. The asm/termios.h caused problems as its termios was smaller than the actual termios. This should be fixed in current rxtx versions but you can just glance at SerialImp.c and make sure it does not include asm/termios.h. I've cc'd the rxtx mail list because there was one other mention of stack problems recently. I have used rxtx on opteron systems with success. I have a bug I'm trying hard to reproduce on suse 64 bit (circa linux 2.4.19) systems though. So far I have not been able to reproduce the bug. That said, with gentoo... I like gentoo but I seriously doubt they do any QA with their kernel and Java. I've seen problems before. If you use gentoo and have Java problems, at least stick to Linus (that is an s there) kernels while using Java. I'm not an expert on gentoo but I've seen patches go into experimental kernels that turn out to break java and are reverted before going to Linus just before I see problems with gentoo on this list. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:16:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:16:14 +0100 (BST) Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: On Tue, 7 Jun 2005, David S. Acker wrote: > Hello, > I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our > product includes a built in USB to Serial adapter so that when it is > connected to your PC over USB, it appears as a serial port. We had problems > with Sun's comm library because it did not detect serial ports coming and > going properly. > > I did run into a few issues with RxTx though. I am building under Windows > (we support XP and 2000) under cygwin. I used a simple make file for the c > code that works under cygwin and ant to build the java stuff. Attached is a > diff file. The patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h for me. Also, > gcc didn't like a local file (win32termios.h) getting included with <> . > > RXTXPort.java - You can get an exception during the writeByte, writeArray, > nativeDrain, readByte, read, readArray, readTerminatedArray, and > nativeAvailable calls. Without this patch the IOLocked count gets stuck > incremented. > > termios.c - If you try to open a port through CreateFile and get > ERROR_ACCESS_DENIED it means someone else is using the port. We need to > make sure to use serial_close instead of just close. I found that some > devices finish their I/O synchronously. The code was treating this as an > error. I also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we must use quotes > and not <> to include win32termios.h . I also commented out a report call > since it seems to happen constantly on my system. > > Feel free to use these in any way that you want or just to ignore them. > Thanks! > Hi Dave These patches look great as is. Thanks. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:33:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:33:16 +0100 (BST) Subject: [Rxtx] Patch to IOLocked (fwd) Message-ID: This appears to be another solution to the locking. Chris, the other option just moves the locking into the finally clause which I think would be a little cleaner though I'm posting this patch to so people can comment. -- Trent Jarvi tjarvi at qbang.org ---------- Forwarded message ---------- Date: Wed, 1 Jun 2005 13:01:32 +0100 From: Christopher Dawes To: taj at www.linux.org.uk Subject: Patch to IOLocked Do you want me to check it out of CVS and then submit changes? Christopher -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXPort.java.diff Type: application/octet-stream Size: 6965 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/c442f9fc/RXTXPort.java-0399.obj From Christopher.Dawes at retail-logic.com Wed Jun 8 00:57:24 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 8 Jun 2005 07:57:24 +0100 Subject: [Rxtx] Patch to IOLocked (fwd) [Virus Checked] In-Reply-To: Message-ID: Agreed, much better Java :-) Thanks Christopher ------------------------------------------- Consultant Engineer Retail Logic Limited Fleet GU51 3TZ Tel: +44 (0)1252 644377 Mob: +44 (0)7899 842759 Fax: +44 (0)1252 776708 rxtx-bounces at mail.electronpusher.org wrote on 07/06/2005 21:33:16: > > This appears to be another solution to the locking. Chris, the other > option just moves the locking into the finally clause which I think would > be a little cleaner though I'm posting this patch to so people can > comment. > > -- > Trent Jarvi > tjarvi at qbang.org > > ---------- Forwarded message ---------- > Date: Wed, 1 Jun 2005 13:01:32 +0100 > From: Christopher Dawes > To: taj at www.linux.org.uk > Subject: Patch to IOLocked > > Do you want me to check it out of CVS and then submit changes? > > Christopher[attachment "RXTXPort.java.diff" deleted by Chris > Dawes/Retaillogic/NISABA] _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx From zempftman at gmail.com Wed Jun 8 07:57:25 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 09:57:25 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Maxwell Zempftman Date: May 27, 2005 5:01 PM Subject: Re: [Rxtx] Kaffe & rxtx & armv5b To: rxtx at mail.linuxgrrls.org Here are the results from working this week: The "NullPointerExceptions" are generated by the software when I choose a bad device file. I discovered that this occurs on the i686-RedHat box as well. This exception seems to be generated only by this particular application, and not by the example programs in contrib. So, for example: java MyApp /dev/null <-- generates NullPointerException java MyApp fake <-- generates NullPointerException java MyApp /dev/ttyS0 <-- does not generate NullPointerException Using the program CommCheck (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it appears as though /dev/ttyS0 is the only valid serial device file on the XScale device, so the errors I was getting are not really be bugs. Although /dev/ttyS0 did not generate NullPointerExceptions, I did encounter this error: --start java MyApp /dev/ttyS0 (going mostly from memory, not exact) PortList.hasMoreElements: true Listening on: /dev/ttyS0 Client connected. >From net: echo kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 vmExcept_setJNIFrame Assert: on 'fp != 0' failed. --end I took a look at exception.h, and it seems as though the problematic code does not exist in newer versions of Kaffe (I have been using CVS-2004-11). Next week I will try to use a newer version, although so far everything but CVS-2004-11 has failed. Also, I the device files I need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with something like this? Thanks, Max. > On 5/21/05, Trent Jarvi wrote: > > I'm not sure what is wrong in the first part. It sounds like your > > application may be swallowing an exception while trying to enumerate the > > port or open it. The usual mistake made it not having permissions to > > either open the port or create the lockfile. There should be examples in > > the contrib directory you can try that enumerate and open ports. Maybe > > that will give you some hints. > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > Sun's code limiting you there though you do need to compile and install > > rxtx for the XScale with Sun's Commapi. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > From taj at www.linux.org.uk Wed Jun 8 08:22:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 15:22:44 +0100 (BST) Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > ---------- Forwarded message ---------- > From: Maxwell Zempftman > Date: May 27, 2005 5:01 PM > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > To: rxtx at mail.linuxgrrls.org > > > Here are the results from working this week: > > The "NullPointerExceptions" are generated by the software when I > choose a bad device file. I discovered that this occurs on the > i686-RedHat box as well. This exception seems to be generated only by > this particular application, and not by the example programs in > contrib. So, for example: > > java MyApp /dev/null <-- generates NullPointerException > java MyApp fake <-- generates NullPointerException > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > Using the program CommCheck > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > appears as though /dev/ttyS0 is the only valid serial device file on > the XScale device, so the errors I was getting are not really be bugs. > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > encounter this error: > > --start > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > PortList.hasMoreElements: true > Listening on: /dev/ttyS0 > Client connected. > >From net: echo > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > --end > > I took a look at exception.h, and it seems as though the problematic > code does not exist in newer versions of Kaffe (I have been using > CVS-2004-11). Next week I will try to use a newer version, although so > far everything but CVS-2004-11 has failed. Also, I the device files I > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > something like this? > In RXTXCommDriver, just look for the following code and add /dev/ttyM to the list. Moxa? if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } So: if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyM", // for Moxa ports "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } Linux just has way too many port types to try enumerating them all. There is potential we can add them back in with udev now. > Thanks, > Max. > > > On 5/21/05, Trent Jarvi wrote: > > > I'm not sure what is wrong in the first part. It sounds like your > > > application may be swallowing an exception while trying to enumerate the > > > port or open it. The usual mistake made it not having permissions to > > > either open the port or create the lockfile. There should be examples in > > > the contrib directory you can try that enumerate and open ports. Maybe > > > that will give you some hints. > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > Sun's code limiting you there though you do need to compile and install > > > rxtx for the XScale with Sun's Commapi. > > > > > > -- > > > Trent Jarvi > > > tjarvi at qbang.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Wed Jun 8 12:16:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 08 Jun 2005 13:16:03 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A60B8D.8080500@cs.umn.edu> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> Message-ID: <42A735E3.8040706@atcorp.com> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual serial comport. This isn't so much of a problem, what is, however, is that the comport does not appear to be able to be set to any arbitrary speed, only those from the data_rate enum. I've not found much on using different speeds, has anyone else encountered anything similar? I greatly appreciate any and all comments and suggestions. Thanks in advance, ~ Shawn Lavelle From zempftman at gmail.com Wed Jun 8 12:50:58 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 14:50:58 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: Thanks Trent! That will solve one of the problems. I don't know when my next chance to work on it will be, but I still need to figure out the error I got when I tried opening '/dev/ttyS0' on the Moxa device regarding a failed assertion, seemed to be a Kaffe issue. Thanks for you help, hope to have results soon, Max Englander. On 6/8/05, Trent Jarvi wrote: > On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > > > ---------- Forwarded message ---------- > > From: Maxwell Zempftman > > Date: May 27, 2005 5:01 PM > > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > > To: rxtx at mail.linuxgrrls.org > > > > > > Here are the results from working this week: > > > > The "NullPointerExceptions" are generated by the software when I > > choose a bad device file. I discovered that this occurs on the > > i686-RedHat box as well. This exception seems to be generated only by > > this particular application, and not by the example programs in > > contrib. So, for example: > > > > java MyApp /dev/null <-- generates NullPointerException > > java MyApp fake <-- generates NullPointerException > > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > > > Using the program CommCheck > > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > > appears as though /dev/ttyS0 is the only valid serial device file on > > the XScale device, so the errors I was getting are not really be bugs. > > > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > > encounter this error: > > > > --start > > > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > > > PortList.hasMoreElements: true > > Listening on: /dev/ttyS0 > > Client connected. > > >From net: echo > > > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > > > --end > > > > I took a look at exception.h, and it seems as though the problematic > > code does not exist in newer versions of Kaffe (I have been using > > CVS-2004-11). Next week I will try to use a newer version, although so > > far everything but CVS-2004-11 has failed. Also, I the device files I > > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > > something like this? > > > > > In RXTXCommDriver, just look for the following code and add /dev/ttyM to > the list. Moxa? > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > So: > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyM", // for Moxa ports > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > Linux just has way too many port types to try enumerating them all. There > is potential we can add them back in with udev now. > > > > > Thanks, > > Max. > > > > > On 5/21/05, Trent Jarvi wrote: > > > > I'm not sure what is wrong in the first part. It sounds like your > > > > application may be swallowing an exception while trying to enumerate the > > > > port or open it. The usual mistake made it not having permissions to > > > > either open the port or create the lockfile. There should be examples in > > > > the contrib directory you can try that enumerate and open ports. Maybe > > > > that will give you some hints. > > > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > > Sun's code limiting you there though you do need to compile and install > > > > rxtx for the XScale with Sun's Commapi. > > > > > > > > -- > > > > Trent Jarvi > > > > tjarvi at qbang.org > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- > Trent Jarvi > tjarvi at qbang.org > From taj at www.linux.org.uk Wed Jun 8 12:53:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 19:53:10 +0100 (BST) Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A735E3.8040706@atcorp.com> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: On Wed, 8 Jun 2005, Shawn Lavelle wrote: > Hello, > I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate > with a virtual serial comport. This isn't so much of a problem, what > is, however, is that the comport does not appear to be able to be set to > any arbitrary speed, only those from the data_rate enum. I've not found > much on using different speeds, has anyone else encountered anything > similar? I greatly appreciate any and all comments and suggestions. > This problem is a bit more tricky than it should be. POSIX systems just have a few specified baud rates. Solaris is one of these systems. CommAPI baud rates probably came from someone looking at Solaris. RXTX tries to be POSIX like. W32 is treated as a POSIX like system via a termios.c file in rxtx. Serial ports have baudbase and divisor. So you can set these to come close to the baudrate you want. Some funky equipment like automobile test equipment use baud rates that are not really possible with PC hardware. But if you get as close as possible by changing baud base and divisor, it works. Windows can actually do this for you. I don't know exactly what their code does but if you pass a baudrate to windows, it will guestimate a baudbase and divisor. So you just pass it 10200 baud and it does its job. This is not of very much use the way rxtx does things though. Linux has the standard POSIX like baud rates but if you set the baud rate to B38400, you can set your own baud base and divisor. This is not POSIX that I know of. W32 has more capability than POSIX like systems too. So I did some work to have windows work like Linux via termios.c But the code is not quit right. SerialImp.c and termios.c need some work so all the various buadrates work on Linux and W32. Most other systems will not work beyond what CommAPI already specifies without writting kernel drivers. This is on my todo list but if someone gets to it first, all the better. -- Trent Jarvi tjarvi at qbang.org From carobizar at free.fr Thu Jun 9 06:39:10 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Thu, 9 Jun 2005 14:39:10 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: <1118320750.42a8386e6d3ce@imp5-q.free.fr> Hi ! Thank you for all your advices. I managed to use rxtx on Windows but I have still some difficulties on Linux. I have yet follow your instructions and the configure file has created : - librxtxSerial.so and librxtxParallel.so in the directory /usr/java/j2sdk1.4.2_08/jre/lib/i386 - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the directory /usr/java/j2sdk1.4.2_08/jre/lib - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext But when I run my program, Some exceptions occur : Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver So, 1) What have I forgotten ? 2) Is it possible to make my application run on Linux without the jdk (only the jre) ? Best regards, Caroline. From taj at www.linux.org.uk Thu Jun 9 07:28:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 9 Jun 2005 14:28:05 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118320750.42a8386e6d3ce@imp5-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: On Thu, 9 Jun 2005 carobizar at free.fr wrote: > Hi ! > Thank you for all your advices. > I managed to use rxtx on Windows but I have still some difficulties on Linux. > I have yet follow your instructions and the configure file has created : > - librxtxSerial.so and librxtxParallel.so in the directory > /usr/java/j2sdk1.4.2_08/jre/lib/i386 > - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the > directory /usr/java/j2sdk1.4.2_08/jre/lib > - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext > > But when I run my program, Some exceptions occur : > Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while > loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > com.sun.comm.SolarisDriver > > So, > 1) What have I forgotten ? > The native (.so) libraries are not installed in a directory the JRE is looking for native libraries in. You may look around and see where the .so libraries are in the JRE. I don't know that the jre/lib/i386 directory is specified as a required directory for JREs. I noticed some do not use it. You may try printing the java.libarary.path to see your options. It is also possible to alter the java.library.path. > 2) Is it possible to make my application run on Linux without the jdk (only the > jre) ? Yes. Though installation from source with the JDK is less error prone. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0396.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 7 15:03:09 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 07 Jun 2005 16:03:09 -0500 Subject: [Rxtx] Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <42A60B8D.8080500@cs.umn.edu> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual comport. This isn't so much of a problem, what is, however, is that the comport is only ever set to 9600 baud. I've not found this as a documented bug, has anyone else encountered anything similar? I'll try and provide more detail tomorrow, but if anyone has any suggestions or encountered this before, I'd like to hear about it. Thanks in advance, ~ Shawn Lavelle From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0399.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0399.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0399.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Mon Jun 20 01:04:40 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 20 Jun 2005 08:04:40 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: <42B66A88.4060806@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050620/9be208a1/attachment-0399.html From fbalzarro at libero.it Mon Jun 20 02:33:52 2005 From: fbalzarro at libero.it (Fabio Balzarro) Date: Mon, 20 Jun 2005 10:33:52 +0200 Subject: [Rxtx] RXTXPort:close detected bad file descriptor Message-ID: I'm using RXTX libraries on IPAQ 4150 PDA with Windows CE 4.20 and Jeode. When I close a serial port with sp.close() (where sp is a SerialPort) sometimes an error occour 1119256168085: RXTXPort:close detected bad file descriptor What can I do? Thanks Fabio ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From slavelle at atcorp.com Mon Jun 20 08:08:19 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 20 Jun 2005 09:08:19 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: <42B6CDD3.4040409@atcorp.com> It turns out that I did have a driver-not-used issue which has now been resolved and I can use RxTx on it (had to add ttyUSB as a valid port), but only at standard baud rates. Does USB have the same restrictions on port speed as regular RS232? ~ Shawn Trent Jarvi wrote: > Just a note here. > > I have requested a FTDI usb device and they offered to send one for the > purpose of trying to get rxtx working. I have no idea how long that takes > though. > > > On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > > >>I'm afraid we're just using the latest version from the FTDI website. I've >>not yet played with linux properly with this and unfortunately I run gentoo >>and haven't yet successfully compiled in the ftdi driver. I'll let you know >>if I get any success. >> >>Appologies >> >>Christopher >> >>-----Original Message----- >>From: rxtx-bounces at mail.electronpusher.org >>[mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle >>Sent: 15 June 2005 00:00 >>To: Java RXTX discussion >>Subject: Re: [Rxtx] Virtual Com Ports >> >>Hmm, the latter sounds like a lot of work. It does find the virtual comport >>in windows, i must have just missed it earlier (sign of a long day). On the >>linux side, I suspect that something is not correct with the driver >>installation becuase it does not give me a tty for it :( >> >>Christopher, May I ask what driver you are using for your FTDI chip? >>Did you ever encounter problems with not getting a tty assigned for it? >> >> >> Thanks for all your help! >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>They will have to show up as a tty device in Linux. Probably ttyUSB? >>>That will need an entry in RXTXCommDriver.java. If they dont show up >>>as a tty device, rxtx cant treat it like a serial port. It just wont >> >>work. >> >>>With COM3, rxtx will try to open the port and perform a timed out read. >>>Usually if a port is not there, the read blows up or the open blows up. >>>Timing out is fine. COM3 used to share interrupts with COM1. I know >>>you can reassign ports in XP. RXTX scans up through COM255. You may >>>try moving it. >>> >>> >>>The code in question is the following in RXTXCommDriver.java >>> >>> >>> if(osName.equals("Linux")) >>> { >>> String[] Temp = { >>> "ttyS", // linux Serial Ports >>> "ttySA", // for the IPAQs >>> "ttyUSB" // for USB frobs >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>> else if(osName.toLowerCase().indexOf("windows") != -1 ) >>> { >>> String[] Temp = { >>> "COM" // win32 serial ports >>> //"//./COM" // win32 serial ports >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>>If COM3 can be read, it should be found. the ttyUSB should work if >>>thats in the version of RXTXCommDriver.java you have. >>> >>>If this is still a problem, it may be that the driver is erroring on >>>what may be considered normal comm port operations such as setting the >>>speed, timeout, threshold, .. One would have to start looking at each >>>function called in the native open() and read(). >>> >>> >>> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>>seems to find the device using rxtx. Looking at the hardware >>>>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>>>linux. I can't seem to get it to show up as a tty(s#) in linux which >>>>is probably just due to my lack of significant linux knowledge. >>>> >>>> ~ Shawn >>>> >>>>Trent Jarvi wrote: >>>> >>>> >>>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>Has anyone here noticed that virtual comports do not get enumerated >>>>>>via CommPortIdentifier.getPortIdentifiers()?? >>>>>> >>>>>>The device I'm trying to talk to uses an fdti usb to serial >>>>>>convertor with a driver that has it show up as a virtual comport. I >>>>>>can enter this port manually and it will be usable but I cannot get >>>>>>it show up automatically (as in the simple serial demo). Any thoughts >> >>on this? >> >>>>> >>>>>Hi Shawn, >>>>> >>>>>What OS is this and what is the name of the virtual port you are >>>>>trying to open? I suspect the name just needs to be added to >> >>RXTXCommDriver.java. >> >>>>_______________________________________________ >>>>Rxtx mailing list >>>>Rxtx at mail.electronpusher.org >>>>http://www.electronpusher.org/mailman/listinfo/rxtx >>>> >>> >>> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From lyon at docjava.com Mon Jun 20 15:06:08 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 20 Jun 2005 17:06:08 -0400 Subject: [Rxtx] testing Message-ID: Hi All, I am testing my new multi-platform Java Webstart RXTX application (Trent: I could not have done it without you!). So far, I think it will work under Linux (x86), Windows XP, Windows 2000 and MacOS X. The application is available as a Java webstart application at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Edit:Preferences: SerialPort Setup... should bring up a dialog box that enables dialing via the modem. Generally, it does not find internal modems (except on the mac). Why, I don't know. Thanks in advance for trying this new app. All feedback on it is welcome. - Doug Lyon From jasmine at electronpusher.org Tue Jun 21 04:15:53 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Tue, 21 Jun 2005 11:15:53 +0100 Subject: [Rxtx] testing In-Reply-To: References: Message-ID: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > Hi All, > I am testing my new multi-platform Java Webstart RXTX application > (Trent: I could not have done it without you!). > > So far, I think it will work under Linux (x86), Windows XP, > Windows 2000 and MacOS X. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. -J. From taj at www.linux.org.uk Tue Jun 21 05:50:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 12:50:23 +0100 (BST) Subject: [Rxtx] testing In-Reply-To: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> References: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> Message-ID: On Tue, 21 Jun 2005, Jasmine Strong wrote: > > On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > > > Hi All, > > I am testing my new multi-platform Java Webstart RXTX application > > (Trent: I could not have done it without you!). > > > > So far, I think it will work under Linux (x86), Windows XP, > > Windows 2000 and MacOS X. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > on my Mac. > passing -source 1.3 -target 1.3 to javac will compile classes without this problem. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 10:19:25 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 11:19:25 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. Sincerely, Jeremyah Payne From ricardo.trindade at emation.pt Tue Jun 21 13:25:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 20:25:00 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B8698C.2060509@emation.pt> Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > From taj at www.linux.org.uk Tue Jun 21 13:39:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:39:43 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <42B8698C.2060509@emation.pt> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> <42B8698C.2060509@emation.pt> Message-ID: It looks like he has an rs422 device/converter. This is not the problematic 'trying to do protocol X with a serial port' situation unless I'm missing something. I'll follow up with the other email I started. On Tue, 21 Jun 2005, Ricardo Trindade wrote: > Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. > > Payne, Jeremyah L (N-CIM) wrote: > > >Good morning, my name is Jeremyah and I am working on a java project to > >interface with some devices. In short, I have a laptop with a PCMIA > >converter that does RS422 running windows 2000. I also will be > >installing some PCI cards into some Linux boxes that will have probably > >4-8 RS422 ports on them. After doing some reading in order to talk > >with these items using my existing java code I will need an additional > >driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > >trying to get a map sort of where I need to make changes. As I see it, > >I would need to subclass SerialPort to my RS422 interface. That would > >link with a DLL or SO implementation that talks with the hardware. I > >also need to change the listing of working ports in the lookup section > >for serial. Does this seem like I am on the right track? Appreciate > >the support. > > > > > >Sincerely, > >Jeremyah Payne > >_______________________________________________ > >Rxtx mailing list > >Rxtx at mail.electronpusher.org > >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 21 13:40:25 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:40:25 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: On Tue, 21 Jun 2005, Payne, Jeremyah L (N-CIM) wrote: > Good morning, my name is Jeremyah and I am working on a java project to > interface with some devices. In short, I have a laptop with a PCMIA > converter that does RS422 running windows 2000. I also will be > installing some PCI cards into some Linux boxes that will have probably > 4-8 RS422 ports on them. After doing some reading in order to talk with > these items using my existing java code I will need an additional > driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > trying to get a map sort of where I need to make changes. As I see it, I > would need to subclass SerialPort to my RS422 interface. That would link > with a DLL or SO implementation that talks with the hardware. I also > need to change the listing of working ports in the lookup section for > serial. Does this seem like I am on the right track? Appreciate the > support. > Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 13:40:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 14:40:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618954@emss02m08.us.lmco.com> I'd like to except I am dealing with NASA. I am basically building a system to monitor 100+ Units that communicate over RS422. They have some converters in place but want to get rid of them. I'll check through the archives. I had started looking yesterday as was leaving work. -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Ricardo Trindade Sent: Tuesday, June 21, 2005 2:25 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From slavelle at atcorp.com Tue Jun 21 14:58:06 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 21 Jun 2005 15:58:06 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: <42B87F5E.4000403@atcorp.com> > Linux has the standard POSIX like baud rates but if you set the baud rate > to B38400, you can set your own baud base and divisor. This is not POSIX > that I know of. W32 has more capability than POSIX like systems too. So > I did some work to have windows work like Linux via termios.c > > But the code is not quit right. SerialImp.c and termios.c need some > work so all the various buadrates work on Linux and W32. Most other > systems will not work beyond what CommAPI already specifies without > writting kernel drivers. > > This is on my todo list but if someone gets to it first, all the better. Hmm, I guess I didn't read this close enough before. Just to be clear, the pieces to setBaudBase and setDivisor are not yet implemented, correct? Thanks, Shawn From sean_montgomery at baseview.com Tue Jun 21 15:14:08 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 21 Jun 2005 17:14:08 -0400 Subject: [Rxtx] OS X installation - file locations Message-ID: <8AB82C7F-0D19-45F9-AE54-A12C59A8495E@baseview.com> Greetings, I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) using the RXTX installation instructions. RXTX worked fine. Basically you've got: - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions - javax.comm.properties in /System/Library/Frameworks/ JavaVM.framework/Home/lib - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ lib/ext My coworker was concerned that the installation required files to be placed in /System/Library... because those directories are "Apple's" and subject to change at Apple's whim, and that it would be safer (less likely to break when a user updates their OS or Java version or what have you) if all the files could be somewhere in /Library... or / Library/Java. My coworker points out that when 3rd party apps like FrontBase and JBoss need to communicate with Java their jars are placed in /Library/Java/Extensions. Granted that RXTX 2.0 is implementing javax.comm and not just a 3rd party extension, might that be the case - that javax.* stuff needs to be in the Java system files? I'm not the Java maven that my coworker is, so I don't know if any of this is gospel or not. Any OS X/Java experts out there willing to comment? We'd like to be able to install RXTX in the safest, most maintenance free way possible, but if there are specific reasons why javax.comm.properties and comm.jar need to be in /System... then so be it. Any information is welcome, Sean From ricardo.trindade at emation.pt Tue Jun 21 15:56:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 22:56:53 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B88D25.7060604@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050621/f6c9f5fe/attachment-0399.html From jeremyah.l.payne at lmco.com Tue Jun 21 15:22:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 16:22:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618955@emss02m08.us.lmco.com> -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Trent Jarvi Sent: Tuesday, June 21, 2005 2:40 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 As of yet we have not decided on the PCI boards to use yet So I am still waiting to se how we will interface to them. But the laptop is ready to use so ill build a test app for that API for now. The overview of class structure is really what I needed. I guess I will use the 2.1 as you suggested. Thanks for the help thus far! BTW, you guys wouldn't happen to keep class diagrams or anything of that nature around would you? If not I will probably end up having to do some anyway for documentation purposes, I could include them. Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From dmarkman at mac.com Tue Jun 21 18:13:28 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 21 Jun 2005 20:13:28 -0400 Subject: [Rxtx] OS X installation - file locations In-Reply-To: References: Message-ID: <044F520C-585C-4B99-82ED-3BA83DB8CE77@mac.com> Apple doesn't recommend to put jars into the /System/Library/Frameworks/JavaVM.framework/Home/lib/ext folder from other hands it's standard java directory to put extentions if you want to support comm api on whole system then I'd recommend to put jars into the /Library/Java/Extensions folder just like you did if you want to support comm api per user put your jars into the ~/ Library/Java/Extensions On Jun 21, 2005, at 5:14 PM, Java RXTX discussion wrote: > Greetings, > > > I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) > using the RXTX installation instructions. RXTX worked fine. > > > Basically you've got: > - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions > - javax.comm.properties in /System/Library/Frameworks/ > JavaVM.framework/Home/lib > - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ > lib/ext > > > My coworker was concerned that the installation required files to be > placed in /System/Library... because those directories are "Apple's" > and subject to change at Apple's whim, and that it would be safer > (less likely to break when a user updates their OS or Java version or > what have you) if all the files could be somewhere in /Library... or / > Library/Java. My coworker points out that when 3rd party apps like > FrontBase and JBoss need to communicate with Java their jars are > placed in /Library/Java/Extensions. Granted that RXTX 2.0 is > implementing javax.comm and not just a 3rd party extension, might > that be the case - that javax.* stuff needs to be in the Java system > files? > > > I'm not the Java maven that my coworker is, so I don't know if any of > this is gospel or not. Any OS X/Java experts out there willing to > comment? We'd like to be able to install RXTX in the safest, most > maintenance free way possible, but if there are specific reasons why > javax.comm.properties and comm.jar need to be in /System... then so > be it. > > > Any information is welcome, > > > Sean > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Dmitry Markman Dmitry Markman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050622/beea65d0/attachment-0399.html From lyon at docjava.com Thu Jun 23 04:39:47 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 23 Jun 2005 06:39:47 -0400 Subject: [Rxtx] web start + RXTX = strange errors? Message-ID: On: Date: Tue, 21 Jun 2005 11:15:53 +0100 From: Jasmine Strong Writes: An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. ----------- I cannot duplicate your error. My version of Java is: java -version java version "1.4.2_05" Is yours the same? Trent: You wrote: passing -source 1.3 -target 1.3 to javac will compile classes without this problem. ----------- OK, I have updated the disto to work with jdk1.3: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Jasmine: Is this working any better? Thanks! - DL From handzisk at tkn.tu-berlin.de Fri Jun 24 02:37:14 2005 From: handzisk at tkn.tu-berlin.de (Vlado Handziski) Date: Fri, 24 Jun 2005 10:37:14 +0200 (CEST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace Message-ID: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Hi all, let me first express my compliments on the great work you have done with the RXTX library. We have been using the library for some time, and we are at a point where we want to make our code public. For legacy reasons, the code that the RXTX library is bundled with, uses the javax.comm namespace. We have been using the ChangePackage script to change the RXTX2.1 package from gnu.io into javax.comm. We need the independent implementation since we want to be able to directly access /dev/ttyUSBx ports in linux and the CommAPI versions are just not as stable. On the download page, there is a comment that this is in violation of sun's license. Can someone shed more light on this. I was not aware that you can protect the names of the java packages. Best regards, Vlado From ricardo.trindade at emation.pt Fri Jun 24 04:01:17 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 11:01:17 +0100 Subject: [Rxtx] parity missed Message-ID: <42BBD9ED.3060004@emation.pt> Hi, I have a "parity missed error". From previous posts I believe this has to do with CMSPAR not being defined. I checked out 2.1 head from CVS. How can I make sure I do a proper build and CMSPAR is defined ? Perhaps it would be good to have a release snapshot that has this, I think the latest snapshot (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. Another question I have, is why must this depend on kernel headers, why can't it be defined in the RXTX source ? thanks Ricardo From jasmine at electronpusher.org Fri Jun 24 04:09:06 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 24 Jun 2005 11:09:06 +0100 Subject: [Rxtx] web start + RXTX = strange errors? In-Reply-To: References: Message-ID: <644aad2bdbba950f0a2fb12d7dcfd8a6@electronpusher.org> On 23 Jun 2005, at 11:39, Dr. Douglas Lyon wrote: > OK, I have updated the disto to work with jdk1.3: > http://show.docjava.com:8086/book/cgij/code/jnlp/ > addbk.JAddressBook.Main.jnlp > > Jasmine: Is this working any better? Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) -J. From taj at www.linux.org.uk Fri Jun 24 10:54:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 17:54:12 +0100 (BST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: On Fri, 24 Jun 2005, Vlado Handziski wrote: > Hi all, > > let me first express my compliments on the great work you have done with > the RXTX library. > > We have been using the library for some time, and we are at a point where > we want to make our code public. For legacy reasons, the code that the > RXTX library is bundled with, uses the javax.comm namespace. We have been > using the ChangePackage script to change the RXTX2.1 package from gnu.io > into javax.comm. We need the independent implementation since we want to > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > versions are just not as stable. > > On the download page, there is a comment that this is in violation of > sun's license. Can someone shed more light on this. I was not aware that > you can protect the names of the java packages. > > Best regards, > Vlado > I can't provide legal advice as I am not a lawyer. (v) may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are contained in the "java", "javax" or "sun" packages or similar as specified by Sun in any class file naming convention; and The license is in the commapi package from Sun. The above is also in all the EULA's you click through to download from Sun if I'm not mistaken. Simply put, the license taints developers that agree to it. For those developers, Sun has control of the javax.comm namespace. It really does not make sense to put rxtx 2.1 in the javax.comm namespace. It will only cause confusion which I think is the point of the clause above. The gnu.io namespace was perhaps a poor choice and just tossed in when reviewing the license to get out of Sun's namespace. There is nothing in the rxtx license limiting your freedom in this fashion though. Many companies are moving to gnu.io and some distribute it with popular applications you would recognize. I'm tempted to ask you not to contaminate rxtx 2.1 with the javax.comm namespace. You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) extensions to existing classes (which I dont think you are using); it is not just javax.comm. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 24 13:24:09 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 20:24:09 +0100 (BST) Subject: [Rxtx] parity missed In-Reply-To: <42BBD9ED.3060004@emation.pt> References: <42BBD9ED.3060004@emation.pt> Message-ID: On Fri, 24 Jun 2005, Ricardo Trindade wrote: > Hi, > > I have a "parity missed error". From previous posts I believe this > has to do with CMSPAR not being defined. > I checked out 2.1 head from CVS. How can I make sure I do a proper > build and CMSPAR is defined ? Perhaps it would be good to have a release > snapshot that has this, I think the latest snapshot > (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. > > Another question I have, is why must this depend on kernel headers, > why can't it be defined in the RXTX source ? > I used to cheat and grab the CMSPAR from the kernel headers because glibc did not have it. Now rxtx uses the glibc headers and we have a patch in glibc I trust that handles this. It would not be right to override glibc and it wasnt right to use the kernel headers (it really did cause problems). You can override glibc for now with the following in the top of SerialImp.c # define CMSPAR 010000000000 You can check if your distro headers have this right bit looking for the above in bits/termios.h. It should look like this: #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif If it is not defined, please file a bug with your distro as rxtx is not the only thing that will be broken on that distro. I was going to release new cvs snapshots last weekend but got tied up. I'll do it this weekend. I also need to get custom baudrate patches into the cvs snapshot. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Fri Jun 24 13:56:50 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 20:56:50 +0100 Subject: [Rxtx] parity missed In-Reply-To: References: <42BBD9ED.3060004@emation.pt> Message-ID: <42BC6582.2070805@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050624/e3b39631/attachment-0399.html From vlado.handziski at gmail.com Sat Jun 25 06:25:52 2005 From: vlado.handziski at gmail.com (Vlado Handziski) Date: Sat, 25 Jun 2005 14:25:52 +0200 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: <697986ec05062505256ebf381f@mail.gmail.com> Thanks for the clarification. Since changing the bundled source is not an option at this moment, we will consider using javax.comm and RXTX2.0. In the next rewrite, we would probably move to gnu.io . Best regards, Vlado Handziski On 6/24/05, Trent Jarvi wrote: > > On Fri, 24 Jun 2005, Vlado Handziski wrote: > > > Hi all, > > > > let me first express my compliments on the great work you have done with > > the RXTX library. > > > > We have been using the library for some time, and we are at a point > where > > we want to make our code public. For legacy reasons, the code that the > > RXTX library is bundled with, uses the javax.comm namespace. We have > been > > using the ChangePackage script to change the RXTX2.1 package from gnu.io > > into javax.comm. We need the independent implementation since we want to > > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > > versions are just not as stable. > > > > On the download page, there is a comment that this is in violation of > > sun's license. Can someone shed more light on this. I was not aware that > > you can protect the names of the java packages. > > > > Best regards, > > Vlado > > > > I can't provide legal advice as I am not a lawyer. > > (v) may not create, or authorize your licensees to create additional > classes, interfaces, or subpackages that are contained in the "java", > "javax" or "sun" packages or similar as specified by Sun in any class file > naming convention; and > > The license is in the commapi package from Sun. The above is also in all > the EULA's you click through to download from Sun if I'm not mistaken. > > Simply put, the license taints developers that agree to it. For those > developers, Sun has control of the javax.comm namespace. > > It really does not make sense to put rxtx 2.1 in the javax.comm namespace. > It will only cause confusion which I think is the point of the clause > above. The gnu.io namespace was perhaps a poor choice and > just tossed in > when reviewing the license to get out of Sun's namespace. > > There is nothing in the rxtx license limiting your freedom in this fashion > though. Many companies are moving to gnu.io and some > distribute it with > popular applications you would recognize. I'm tempted to ask you not > to contaminate rxtx 2.1 with the javax.comm namespace. > > You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm > using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) > extensions to existing classes (which I dont think you are using); it is > not just javax.comm. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050625/1dadc50e/attachment-0399.html From taj at www.linux.org.uk Sun Jun 26 11:34:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 26 Jun 2005 18:34:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. Message-ID: The attached file should fix baud_base and divisor extensions for Linux The patch is against rxtx 2.1 CVS HEAD. To use this patch, you should set the baud rate to 38400. You can then try SerialPort.setBaudBase(int) and SerialPort.setDivisor(int) There are matching int SerialPort.getBaudBase() and int SerialPort.getDivisor(). What baud bases are available depends upon the serial port card and its driver so this is a bit of a blind attempt on my part. I've looked at the w32 API and I dont see anything available yet. The w32 code in RXTX will probably be figuring out the baud rate based on the tried baud base and divisor and just slamming it at the API for now (the API does something with that but I've not found real documentation on what it does). I dont want to try tinkering with the UART directly yet as that would involve poking machine memory directly and could very easily be error prone in bad ways. I don't expect Solaris or any SysV UNIX systems to work at all with this - ever. It is not standard in any way and will throw Exceptions on everything but Linux (w32 will just fail miserably as it is 1/2 implemented). If anyone has looked at custom baud rates before and has some thoughts or just wants to try the attached untested patch, I'd appreciate any feedback. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- ? autom4te.cache ? build ? output cvs server: Diffing . Index: configure =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure,v retrieving revision 1.35.2.59 diff -u -r1.35.2.59 configure --- configure 16 Oct 2004 16:20:34 -0000 1.35.2.59 +++ configure 26 Jun 2005 16:59:28 -0000 @@ -9644,6 +9644,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { #if defined (__GLIBC__) @@ -9782,6 +9784,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { @@ -9825,7 +9829,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -9837,7 +9841,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 26 Jun 2005 16:59:28 -0000 @@ -218,6 +218,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { #if defined (__GLIBC__) @@ -356,6 +358,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { @@ -399,7 +403,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -411,7 +415,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" cvs server: Diffing CNI cvs server: Diffing MACOSX_IDE cvs server: Diffing MACOSX_IDE/CW cvs server: Diffing MACOSX_IDE/ForPackageMaker cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions cvs server: Diffing MACOSX_IDE/ForPackageMaker/Resources cvs server: Diffing MACOSX_IDE/PB cvs server: Diffing WinCE cvs server: Diffing contrib cvs server: Diffing debian cvs server: Diffing src Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 26 Jun 2005 16:59:29 -0000 @@ -2079,15 +2079,17 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int BaudBase The clock frequency divided by 16. Default * BaudBase is 115200. * @return boolean true on success - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:setBaudBase()"); @@ -2097,10 +2099,11 @@ /** * Extension to CommAPI * @return int BaudBase - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getBaudBase() throws UnsupportedCommOperationException + public int getBaudBase() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getBaudBase()"); @@ -2108,13 +2111,14 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, IOException { if ( debug ) z.reportln( "RXTXPort:setDivisor()"); @@ -2124,10 +2128,11 @@ /** * Extension to CommAPI * @returns int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getDivisor() throws UnsupportedCommOperationException + public int getDivisor() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getDivisor()"); Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 26 Jun 2005 16:59:30 -0000 @@ -1877,16 +1877,27 @@ int fd = get_java_var( env, jobj,"fd","I" ); struct serial_struct sstruct; + if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) + { + goto fail; + } + + sstruct.baud_base = (int) BaudBase; + if ( sstruct.baud_base < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetBaudBase", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetBaudBase", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1914,9 +1925,13 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) ( sstruct.baud_base ) ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetBaudBase", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetBaudBase", strerror( errno ) ); @@ -1950,19 +1965,23 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } if ( sstruct.custom_divisor < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetDivisor", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetDivisor", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1971,7 +1990,7 @@ accept: none perform: Find the Divisor used for custom speeds - return: Divisor + return: Divisor negative value on error. exceptions: Unsupported Comm Operation on systems not supporting TIOCGSERIAL comments: @@ -1990,10 +2009,14 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) sstruct.custom_divisor ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetDivisor", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetDivisor", strerror( errno ) ); @@ -2032,7 +2055,7 @@ /* Open and lock the port so nothing else changes the setting */ - if ( LOCK( filename, pid ) ) goto fail;; + if ( LOCK( filename, pid ) ) goto fail; fd = find_preopened_ports( filename ); if( !fd ) Index: src/SerialPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/Attic/SerialPort.java,v retrieving revision 1.3.2.9 diff -u -r1.3.2.9 SerialPort.java --- src/SerialPort.java 12 Oct 2004 08:59:28 -0000 1.3.2.9 +++ src/SerialPort.java 26 Jun 2005 16:59:30 -0000 @@ -103,13 +103,17 @@ public abstract String getUARTType() throws UnsupportedCommOperationException; public abstract boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getBaudBase() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getDivisor() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setLowLatency() throws UnsupportedCommOperationException; public abstract boolean getLowLatency() cvs server: Diffing src/lfd cvs server: Diffing src/psmisc From uwe at kubosch.no Mon Jun 27 14:13:57 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Mon, 27 Jun 2005 22:13:57 +0200 Subject: [Rxtx] RXTX on FC4 Message-ID: <1119903238.2989.27.camel@BPC0276> Hi all! I just got RXTX to work on Fedora Core 4. The standard download did not work. I had to check the code out from CVS and build it, but then it worked flawlessly. Thanks for your good work. Now I wonder if I should contribute the compiled files so that others will have an easier time than me getting RXTX to work on FC4. What do I do? Who do I talk to? donV From taj at www.linux.org.uk Mon Jun 27 14:29:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 27 Jun 2005 21:29:46 +0100 (BST) Subject: [Rxtx] RXTX on FC4 In-Reply-To: <1119903238.2989.27.camel@BPC0276> References: <1119903238.2989.27.camel@BPC0276> Message-ID: On Mon, 27 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I just got RXTX to work on Fedora Core 4. > > The standard download did not work. > > I had to check the code out from CVS and build it, but then it worked > flawlessly. > > Thanks for your good work. > > Now I wonder if I should contribute the compiled files so that others > will have an easier time than me getting RXTX to work on FC4. What do I > do? Who do I talk to? > > The best thing to do with FC is to contibute an extras RPM. Debian does something like this with their .deb packaging. As rxtx is OS neutral, it is almost impossible to have everything on rxtx.org. If you do get a package in Fedora Extras, I can point a link there. The extra's mail list is here: https://www.redhat.com/mailman/listinfo/fedora-extras-list If it would help to have me release a 'stable' .tar.gz of the source for the RPM submittal process I can do that. It would also trigger upgrades in debian which would not be bad. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Mon Jun 27 16:23:20 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 27 Jun 2005 17:23:20 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: Message-ID: <42C07C58.1030608@atcorp.com> Hey Trent, I installed it and now I get IOExceptions instead of the other one. I'm not sure how those changes would have enabled setDivisor and setBaudBase to work though. Is it significant that this is a USB device emulating a serial port? ~ Shawn From taj at www.linux.org.uk Mon Jun 27 18:07:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 01:07:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: <42C07C58.1030608@atcorp.com> References: <42C07C58.1030608@atcorp.com> Message-ID: On Mon, 27 Jun 2005, Shawn Lavelle wrote: > Hey Trent, > I installed it and now I get IOExceptions instead of the other one. > I'm not sure how those changes would have enabled setDivisor and > setBaudBase to work though. Is it significant that this is a USB device > emulating a serial port? > The USB driver probably does not support this. With USB, the ioctl()'s appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through the linux drivers/usb tree and found to ioctl to support this in Linux 2.6.10. RXTX is not doing very much magic, the patch really only gets the serial struct instead of writing a structure with random values for baudbase and handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel level driver issue not a user space library issue. So if you wanted this to work, the usb serial driver would have to handle the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression after looking through the USB tree quickly. I hope that helps. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Jun 27 18:25:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 27 Jun 2005 20:25:22 -0400 Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) Message-ID: Hi All, I wrote: Jasmine: Is this working any better? And Jasmine says: Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) I am using -source 1.3 and -target 1.3 for the compilation, however, we still seem to have this problem, which my machine (for some reason) does not have. Does anyone have any ideas about what might be the problem? Thanks! - DL From taj at www.linux.org.uk Mon Jun 27 19:04:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 02:04:37 +0100 (BST) Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) In-Reply-To: References: Message-ID: On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I wrote: > Jasmine: Is this working any better? > > And Jasmine says: > Nope. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > > I am using -source 1.3 and -target 1.3 > for the compilation, however, we still seem to have this problem, > which my machine (for some reason) does not have. > Does anyone have any ideas about what might be the problem? > This has shown up in the past with jdk 1.5 compiled jars running on jre 1.4 machines. My guess is either jasmine has an old copy of rxtx with the problem on her machine that is being picked up on the classpath or you have not tried this with jre 1.4. The suggested -source/target fix should avoid the problem. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Mon Jun 27 21:23:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 04:23:55 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: On Tue, 28 Jun 2005, Trent Jarvi wrote: > On Mon, 27 Jun 2005, Shawn Lavelle wrote: > > > Hey Trent, > > I installed it and now I get IOExceptions instead of the other one. > > I'm not sure how those changes would have enabled setDivisor and > > setBaudBase to work though. Is it significant that this is a USB device > > emulating a serial port? > > > > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > > RXTX is not doing very much magic, the patch really only gets the serial > struct instead of writing a structure with random values for baudbase and > handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel > level driver issue not a user space library issue. > > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. > > I hope that helps. > > > It may be possible that you can just modify translate_speed and get_java_baudrate in SerialImp.c to have the new high speds you are after. The defines are in /usr/include/termios.h. #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 You can see many of these are not handled. I dont think CommAPI handled more than 57600 or so. int get_java_baudrate( int native_speed ) { switch( native_speed ) { case B0: return 0; case B50: return 50; case B75: return 75; case B110: return 110; case B134: return 134; case B150: return 150; case B200: return 200; case B300: return 300; case B600: return 600; case B1200: return 1200; case B1800: return 1800; case B2400: return 2400; case B4800: return 4800; case B9600: return 9600; case B19200: return 19200; case B38400: return 38400; case B57600: return 57600; default: return -1; } } int translate_speed( JNIEnv *env, jint speed ) { LEAVE( "RXTXPort:translate_speed" ); switch( speed ) { case 0: return B0; case 50: return B50; case 75: return B75; case 110: return B110; case 134: return B134; case 150: return B150; case 200: return B200; case 300: return B300; case 600: return B600; case 1200: return B1200; case 1800: return B1800; case 2400: return B2400; case 4800: return B4800; case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; #ifdef B57600 case 57600: return B57600; #endif /* B57600 */ #ifdef B115200 case 115200: return B115200; #endif /* B115200 */ #ifdef B230400 case 230400: return B230400; #endif /* B230400 */ #ifdef B460800 case 460800: return B460800; #endif /* B460800 */ #ifdef B14400 case 14400: return B14400; #endif /* B14400 */ #ifdef B28800 case 28800: return B28800; #endif /* B28800 */ #ifdef B128000 /* dima */ case 128000: return B128000; #endif /* dima */ #ifdef B256000 /* dima */ case 256000: return B256000; #endif /* dima */ } /* Handle custom speeds */ if( speed >= 0 ) return speed; else { LEAVE( "RXTXPort:translate_speed: Error condition" ); return -1; } } -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 28 05:20:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 28 Jun 2005 07:20:21 -0400 Subject: [Rxtx] cross-compilation using Make for Mac Message-ID: Hi All, Please excuse the long post; Trent said: >" >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. " Here is what I have on the mac version: java -version java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) When I run: http://show.docjava.com:8086/book/cgij/code/jnlp/math.benchmarks.Dhry.jnlp I get: -- listing properties -- jnlpx.heapsize=NULL,NULL jnlpx.splashport=-1 java.runtime.name=Java(TM) 2 Runtime Environment, Stand... java.protocol.handler.pkgs=com.sun.javaws.net.protocol sun.boot.library.path=/System/Library/Frameworks/JavaVM.fra... java.vm.version=1.4.2-38 awt.nativeDoubleBuffering=true gopherProxySet=false http.auth.serializeRequests=true java.vm.vendor="Apple Computer, Inc." java.vendor.url=http://apple.com/ path.separator=: java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io jnlpx.home=/Applications/Utilities/Java/Java Web... user.country=US sun.os.patch.level=unknown java.vm.specification.name=Java Virtual Machine Specification user.dir=/ java.runtime.version=1.4.2_05-141.4 java.awt.graphicsenv=apple.awt.CGraphicsEnvironment java.endorsed.dirs=/System/Library/Frameworks/JavaVM.fra... os.arch=ppc java.io.tmpdir=/tmp line.separator= java.vm.specification.vendor=Sun Microsystems Inc. jnlpx.remove=false os.name=Mac OS X sun.java2d.fontpath= java.library.path=/Applications/Utilities/Java/Java Web... java.specification.name=Java Platform API Specification java.class.version=48.0 jnlpx.deployment.user.home=/Users/lyon/Library/Caches/Java Web S... java.util.prefs.PreferencesFactory=java.util.prefs.MacOSXPreferencesFactory os.version=10.3.9 user.home=/Users/lyon user.timezone=America/New_York java.security.policy=file:/Applications/Utilities/Java/Jav... java.awt.printerjob=apple.awt.CPrinterJob trustProxy=true java.specification.version=1.4 file.encoding=MacRoman jnlpx.deployment.system.home=/Applications/Utilities/Java/J2SE 5.0... user.name=lyon java.class.path=/Applications/Utilities/Java/Java Web... java.vm.specification.version=1.0 sun.arch.data.model=32 java.home=/System/Library/Frameworks/JavaVM.fra... java.specification.vendor=Sun Microsystems Inc. user.language=en awt.toolkit=apple.awt.CToolkit java.vm.info=mixed mode java.version=1.4.2_05 java.ext.dirs=/Users/lyon/Library/Java/Extensions:/... sun.boot.class.path=/System/Library/Frameworks/JavaVM.fra... java.vendor=Apple Computer, Inc. file.separator=/ java.vendor.url.bug=http://developer.apple.com/java/ sun.cpu.endian=big sun.io.unicode.encoding=UnicodeBig mrj.version=141.3 jnlpx.jvm=/System/Library/Frameworks/JavaVM.fra... sun.cpu.isalist= sun.awt.exception.handler=apple.awt.CToolkit$EventQueueExceptio... javawebstart.version=javaws-1.4.2_05 800 mhz g4,878k ds/sec total time: 1184ms Result: 844594 dhrystone/sec. Load average for last 15 minutes:0.62 So, I feel pretty sure that I have tried this with 1.4. As to modifying the RXTX compilation, that I did not do...and I take your point. I have been using the binary distributions as is. Oops. I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Now when I do a make, I get: make gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known libtool: link: warning: undefined symbols not allowed in i386-pc-mingw32 shared libraries rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ln: `SerialImp.o': File exists make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 So, I do a make clean, then a make: .... (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ar cru .libs/librxtxSerial.a /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o ar: /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o: No such file or directory make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 In the i386 directory, there is a symbolic link left from something: ls -al SerialImp.o lrwxrwxrwx 1 lyon lyon 12 Jun 28 07:03 SerialImp.o -> SerialImp.lo However, the SerialImp.lo is not present (which is the cause of the error, I think). On the other hand, the file I am looking for is present in: i686-pc-linux-gnu Possibly the i386 generation is not clean (of course it is also likely that I am just asking dumb questions, being a newbie to the code and all.). Finally, will this make file regenerate the distro for the mac? I found some really old (from year 2001) files in: cvs/MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions Which I could use for the distro...but I would prefer to do a clean, multi-platform build from make. Thanks! - Doug >On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > >> Hi All, >> I wrote: >> Jasmine: Is this working any better? >> >> And Jasmine says: >> Nope. >> >> An error occurred while launching/running the application. >> >> Title: addbk.JAddressBook.Main >> Vendor: DocJava, Inc. >> Category: Unexpected Error >> >> gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) >> >> > > I am using -source 1.3 and -target 1.3 >> for the compilation, however, we still seem to have this problem, >> which my machine (for some reason) does not have. >> Does anyone have any ideas about what might be the problem? >> > >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. > > >The suggested -source/target fix should avoid the problem. > >-- >Trent Jarvi >tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 28 09:43:41 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 28 Jun 2005 10:43:41 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: <42C1702D.1070307@atcorp.com> > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. There is ioctl stuff in the driver for the chip, but i haven't seen the TIOC*SERIAL entries. That might be why it continues to fail. I did get around the problem, though, by hacking the driver and just specifying the baud rate I need. Now everything works well. Thanks for all the assistance you've provided. ~ Shawn M. Lavelle From taj at www.linux.org.uk Tue Jun 28 12:42:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:42:29 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known Add a compiler flag -DWIN32 The code above should not be compiling on w32 as it is #if !defined(WIN32) You can look at the bottom of Makefile.in to see the w32 compile flags. Search for "WIN32 CrossCompiling from here down" If its still not working, I can set you up with the Bob account. Just email me off the list. W32 compiling is a bit complicated. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 28 12:52:50 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:52:50 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Nods. I did change configure but right now it is only in the baudbase/divisor patch I posted. I'm going to add several extension baud rates that can be supported by normal API calls and commit that today as a followup to my comments yesterday on baudrates. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Wed Jun 29 01:52:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 08:52:10 +0100 (BST) Subject: [Rxtx] [PATCH] More baud rate fixes Message-ID: I went through the native baudrate conversion from Java and added several. This patch is against CVS 2.1 head. I think thats it for baud rate fixes unless someone see something. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- A non-text attachment was scrubbed... Name: baud_base_and_divisor_plus_odd_baudrates.diff.gz Type: application/x-gzip Size: 3291 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050629/4c1ef1c2/baud_base_and_divisor_plus_odd_baudrates.diff-0399.gz From lyon at docjava.com Wed Jun 29 10:33:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 29 Jun 2005 12:33:45 -0400 Subject: [Rxtx] java.comm dependencies Message-ID: Hi All, During a build of the rxtx code, I have left the javax.comm out of the system (on purpose). However, I get an error, at run time: CommPortIdentifier:static initialization() apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: javax/comm/CommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver I am thinking that there is something in the gnu.io.CommPortIdentifier that seeks to load the javax.comm.CommDriver. It was my understanding that we could write code without reference to the javax.comm.CommDriver and that we could work in the gnu namespace. Is this true? Thanks! - Doug From taj at www.linux.org.uk Wed Jun 29 11:16:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 18:16:08 +0100 (BST) Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > During a build of the rxtx code, I have left the > javax.comm out of the system (on purpose). > However, I get an error, at run time: > > CommPortIdentifier:static initialization() > apple.awt.EventQueueExceptionHandler Caught Throwable : > java.lang.NoClassDefFoundError: javax/comm/CommDriver > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > that seeks to load the javax.comm.CommDriver. > > It was my understanding that we could write code without reference > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > Is this true? > Yes. People use 2.1 without javax all the time. There should be no reference to javax at all in rxtx 2.1. You may check your code. I just did a grep through 2.1 and there is nothing. You may look at the classes you are using. If you find javax.comm in your code, replace it with gnu.io and that should be all you need to do. -- Trent Jarvi tjarvi at qbang.org From jayant28k at gmail.com Wed Jun 29 21:49:28 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Thu, 30 Jun 2005 09:19:28 +0530 Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: <6a6a02310506292049778c452f@mail.gmail.com> Trent, I think best idea is to have wiki for rxtx code. So as the traffic is increasing with time. "RXTX" seems to be more popular in embbeded system. Sun Microsystems will always apperciate your efforts on parallel and serial ports commincation based application in IT Industry. Thanks for your help on this forum as "ONE MAN ARMY" ;-) Cheers, Jayant On 6/29/05, Trent Jarvi wrote: > On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > > > Hi All, > > During a build of the rxtx code, I have left the > > javax.comm out of the system (on purpose). > > However, I get an error, at run time: > > > > CommPortIdentifier:static initialization() > > apple.awt.EventQueueExceptionHandler Caught Throwable : > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > > that seeks to load the javax.comm.CommDriver. > > > > It was my understanding that we could write code without reference > > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > > > Is this true? > > > > Yes. People use 2.1 without javax all the time. > > There should be no reference to javax at all in rxtx 2.1. You may check > your code. I just did a grep through 2.1 and there is nothing. You may > look at the classes you are using. > > If you find javax.comm in your code, replace it with gnu.io and that > should be all you need to do. > > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From uwe at kubosch.no Sat Jun 25 02:50:24 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Sat, 25 Jun 2005 10:50:24 +0200 Subject: [Rxtx] RXTX in FC3/FC4 Message-ID: <1119689424.12606.14.camel@BPC0276> Hi all! I am trying to get RXTX to work on Fedora Core, version 3 or 4. I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext directory. I have edited the jre/lib/javax.comm.properties according to the docs. I have tried this with both rxtx 2.0 and 2.1. I have tried on two different machines. I have tried with java 1.4.2 and java 1.5.0, both from Sun. I always get a signall 11 from the native libraries when they are loaded. Is this a common problem? Any help is greatly appreciated. Below is the start of the error message. More can be supplied on demand. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x65015A Function=(null)+0x65015A Library=/lib/ld-linux.so.2 NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) - locked <0xed46f628> (a java.util.Vector) - locked <0xed471708> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xed46ebc0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.InitializeDriver(CommPortIdentifier.java:213) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:248) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:351) at com.jpeterson.x10.module.CM11A.allocate(CM11A.java:1160) at net.sourceforge.cruisecontrol.publishers.X10Publisher.send(X10Publisher.java:182) at net.sourceforge.cruisecontrol.publishers.X10Publisher.turnOff(X10Publisher.java:171) at net.sourceforge.cruisecontrol.publishers.X10Publisher.handleBuild(X10Publisher.java:148) at net.sourceforge.cruisecontrol.publishers.X10Publisher.publish(X10Publisher.java:141) at net.sourceforge.cruisecontrol.Project.publish(Project.java:679) at net.sourceforge.cruisecontrol.Project.build(Project.java:227) at net.sourceforge.cruisecontrol.Project.execute(Project.java:153) at net.sourceforge.cruisecontrol.ProjectWrapper.run(ProjectWrapper.java:66) at java.lang.Thread.run(Thread.java:534) From chris_jh at blueyonder.co.uk Tue Jun 28 05:37:10 2005 From: chris_jh at blueyonder.co.uk (Christopher Harris) Date: Tue, 28 Jun 2005 12:37:10 +0100 Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError Message-ID: <42C13666.9030108@blueyonder.co.uk> Hi I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 32bit) The serial ports work fine with no issues, but when i try to use the parallel port i get this message Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:66) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) I am trying to print a line out to port "/dev/lp0" At first i thought it could not find the librxtxParallel.so file, but when i renamed it i got a different saying it could not find the library. I have tried to run as root no difference. It is really weird, i get no compile errors and the serial ports work fine. I changed the LPRPort.java and commented out the Initialize call method. And just get the same error but for the method open. It is as though it can't see the methods, and yet it can see the library. I did have a bit of check of the JNI implementation in rxtx but could not spot anything. Yours Thankfully Christopher Harris From lyon at docjava.com Thu Jun 30 02:28:09 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 04:28:09 -0400 Subject: [Rxtx] tools Message-ID: Hi All, I have been thinking about automatic cross-platform native method development of Java/C programs. It appears that different binary tools are needed to target different platforms. Configuration seems a bit painful. Is there something better available than make? Is ANT any good at this? Has anyone tried: http://jnipp.sourceforge.net/ Thanks! - Doug From lyon at docjava.com Thu Jun 30 04:11:17 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 06:11:17 -0400 Subject: [Rxtx] javax.comm Message-ID: Hi All, When I load my jar files on a linux box, all is well. However, when I load them on a mac, I get: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver The jar files for the mac are different from the jar files for linux, because recompilation of the native code for the mac has not been easy, for me. As a result, the RXTX jars are tending toward specific versions and platforms. Probably, this is not an ideal situation, but, I suspect, it is common. I have an idea that we could create a single JNLP distro site that we can make reference to that would enable a uniform repository of synchronized signed native methods and jars for RXTX. For example, the one-wire Maxim folks have a real-nice approach where their stuff makes reference to another JNLP file that contains all the stuff we need to make RXTX work. Check it out at: http://www.maxim-ic.com/products/ibutton/software/1wire/OneWireViewer.cfm However, even they have problems on an unconfigured machine: Specified adapter name "DS9097U" is not known * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cannot load default adapter. Please check that the adapter is connected and that no other application is using the port. If you have checked the adapter, the default port might not be selected. Either set the value of the TMEX default using the utility provided with the TMEX Runtime, or create a new file in the /lib folder called onewireviewer.properties with two lines, similar to the following: #native win32 drivers adapter.name={DS9097U} adapter.port=COM1 #or javax.comm drivers adapter.name=DS9097U adapter.port=COM1 The full path to this file should be: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/onewireviewer.properties ---- Wow, that is a show stopper! Configuration is something that we really need to think about as an automatic thing, particularly for web start users. You can't ask a person who wants to run an application to figure out how to alter a properties file. If you know you need one, then get permission and make one...automatically. That makes a lot of sense, to me. Basically, we need an installer. At the very least, all the pre-built binaries and jars needed for the RXTX package on several platforms should be available from a single place. One this happens, we can make a JNLP file that is platform specific, but can give us a level of indirection. Is this something that has been done already? Thanks! - Doug From taj at www.linux.org.uk Thu Jun 30 08:10:22 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 15:10:22 +0100 (BST) Subject: [Rxtx] tools In-Reply-To: References: Message-ID: On Thu, 30 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I have been thinking about automatic cross-platform > native method development of Java/C programs. > > It appears that different binary tools are needed to target different > platforms. Configuration seems a bit painful. > > Is there something better available than make? > > Is ANT any good at this? I'm far from an Ant expert but have used it for other projects. The main problem I see with ant is there is no mainstream support for platform neutral neutral library creation as far as I can tell. I think ant is a fine replacement for make but I've not seen a suitable replacement for autoconf. At that point, make is as good as anything. It should be possible to create a ant build.xml that works on say Solaris, Linux, Windows and Mac OS X. The problem is when you are trying to build a library for embeded ARM from Mac OS X. > Has anyone tried: > http://jnipp.sourceforge.net/ -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:22:02 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:22:02 +0100 (BST) Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <1119689424.12606.14.camel@BPC0276> References: <1119689424.12606.14.camel@BPC0276> Message-ID: On Sat, 25 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I am trying to get RXTX to work on Fedora Core, version 3 or 4. > > I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 > directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext > directory. > > I have edited the jre/lib/javax.comm.properties according to the docs. > > I have tried this with both rxtx 2.0 and 2.1. > > I have tried on two different machines. > > I have tried with java 1.4.2 and java 1.5.0, both from Sun. > > I always get a signall 11 from the native libraries when they are > loaded. Is this a common problem? Any help is greatly appreciated. > Below is the start of the error message. More can be supplied on > demand. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x65015A > Function=(null)+0x65015A > Library=/lib/ld-linux.so.2 > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) If you compile rxtx from source, this will probably go away. I'm not sure what the exact cause is but it looks like the binaries are not suitable for FC3/4. The ABI may have changed since those had been compiled. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:26:56 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:26:56 +0100 (BST) Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError In-Reply-To: <42C13666.9030108@blueyonder.co.uk> References: <42C13666.9030108@blueyonder.co.uk> Message-ID: tOn Tue, 28 Jun 2005, Christopher Harris wrote: > Hi > > I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 > 32bit) > > The serial ports work fine with no issues, but when i try to use the > parallel port i get this message > > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:66) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) > > > I am trying to print a line out to port "/dev/lp0" > > At first i thought it could not find the librxtxParallel.so file, but > when i renamed it i got a different saying it could not find the library. > > I have tried to run as root no difference. > > It is really weird, i get no compile errors and the serial ports work fine. > > I changed the LPRPort.java and commented out the Initialize call method. > And just get the same error but for the method open. > > It is as though it can't see the methods, and yet it can see the library. > I did have a bit of check of the JNI implementation in rxtx but could > not spot anything. > > > You can check if the symbols are in the shared library: nm librxtxSerial.so |grep Initialize If the symbols are not there, there was a build error. Watch very close for build errors while compiling from source. I suspect something isnt behaving right. -- Trent Jarvi tjarvi at qbang.org From allen at adbyrne.us Thu Jun 30 06:55:58 2005 From: allen at adbyrne.us (Allen Byrne) Date: Thu, 30 Jun 2005 07:55:58 -0500 Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> References: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> Message-ID: <200506300755.59159.allen@adbyrne.us> On Thursday 30 June 2005 00:31, rxtx-request at mail.electronpusher.org wrote: > >Message: 8 >Date: Sat, 25 Jun 2005 10:50:24 +0200 >From: Uwe Kubosch >Subject: [Rxtx] RXTX in FC3/FC4 >To: rxtx at mail.electronpusher.org >Message-ID: <1119689424.12606.14.camel at BPC0276> >Content-Type: text/plain > >Hi all! > >I am trying to get RXTX to work on Fedora Core, version 3 or 4. > >I have tried this with both rxtx 2.0 and 2.1. > >I have tried on two different machines. > >I have tried with java 1.4.2 and java 1.5.0, both from Sun. > >I always get a signall 11 from the native libraries when they are >loaded. ?Is this a common problem? ?Any help is greatly appreciated. >Below is the start of the error message. ?More can be supplied on >demand. > >An unexpected exception has been detected in native code outside the VM. >Unexpected Signal : 11 occurred at PC=0x65015A >Function=(null)+0x65015A >Library=/lib/ld-linux.so.2 > I had thi same problem on SUSE9.3 and java 1.5.0. After searching through the archives, I found a patch that required adding a sleep(1000) command in two functions of SerialIO.java. This only was for rxtx2.1, I had no trouble with rxtx2.0. Note, also I had to add the "|1.5*" sequence to the configure.in file to get good *.so libs. Again 2.0 was fine. -- Allen Byrne adbyrne at ieee.org http://modelrr.adbyrne.us From taj at www.linux.org.uk Fri Jun 3 01:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 08:57:29 +0100 (BST) Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 3 09:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 16:57:53 +0100 (BST) Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi at qbang.org From jasmine at electronpusher.org Fri Jun 3 10:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 17:12:21 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 11:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:02:09 +0100 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 11:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:05:10 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From jon.nall at gmail.com Mon Jun 6 09:13:58 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 10:13:58 -0500 Subject: [Rxtx] StackOverflowError Message-ID: I have a fairly small application that is communicating to a microcontroller programmer at 115.2k. I have a test where I try and dump the memory of the microcontroller (whose size is 8k and change). Things are going smoothly and the data looks good. Then after reading out ~6.5k of data, I get a StackOverflowError. The stack trace looks like: CommInterface.serialEvent(): 324 // this is my code RXTXPort.sendEvent(): 732 RXTXPort.eventLoop() [Native] MonitorThread.run(): 1531 I am running on windows and using rxtx-2.1-CVS-20050120. When I increased the stack size to 512k, I could read the entire chip without issue. But that doesn't seem like the right thing to do without root causing what's happening. My code doesn't include any recursion and the stack trace looks terribly short, so I'm a bit confused as to why I'm getting a StackOverflowError. CommInterface.serialEvent() does little more than grab the available bytes, enter a synchronized block, stick them in a common data area for the main thread to use and leave the synchronization block. I guess my question is: are there any known issues with the default stack size when using the latest rxtx on windows? thanks, nall. From taj at www.linux.org.uk Mon Jun 6 09:27:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 16:27:34 +0100 (BST) Subject: [Rxtx] StackOverflowError In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > I have a fairly small application that is communicating to a > microcontroller programmer at 115.2k. I have a test where I try and > dump the memory of the microcontroller (whose size is 8k and change). > Things are going smoothly and the data looks good. Then after reading > out ~6.5k of data, I get a StackOverflowError. The stack trace looks > like: > > CommInterface.serialEvent(): 324 // this is my code > RXTXPort.sendEvent(): 732 > RXTXPort.eventLoop() [Native] > MonitorThread.run(): 1531 > > I am running on windows and using rxtx-2.1-CVS-20050120. When I > increased the stack size to 512k, I could read the entire chip without > issue. But that doesn't seem like the right thing to do without root > causing what's happening. My code doesn't include any recursion and > the stack trace looks terribly short, so I'm a bit confused as to why > I'm getting a StackOverflowError. > > CommInterface.serialEvent() does little more than grab the available > bytes, enter a synchronized block, stick them in a common data area > for the main thread to use and leave the synchronization block. > > I guess my question is: are there any known issues with the default > stack size when using the latest rxtx on windows? > This is the first I've heard of the problem. It is strange as you mention lookin at the stack trace. That cant be taking up too much space. If you just toss the data instead of trying to put it in your work area, does it persist? -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Mon Jun 6 10:09:39 2005 From: lengyel at gmail.com (FL) Date: Mon, 6 Jun 2005 12:09:39 -0400 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on which the jdk1.5.0_03 is installed. I found that the INSTALL documentation seems to be in error. It states that javacomm20-x86.tar.Z (the Java Communications API for Solaris/x86) must be used, in fact this choice led to the following test with theBlackBox sample program in the commapi: root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG BlackBox -p /dev/ttyS0 Port /dev/ttyS0 not found! No serial ports found! Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to cause Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to the Eclipse stable build version 3.1M7 to avoid this. However, I found that using the Solaris/Sparc version of commapi worked on my system. I have documented this on: http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050606/b28fb9a7/attachment-0400.html From taj at www.linux.org.uk Mon Jun 6 10:30:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:30:27 +0100 (BST) Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, FL wrote: > I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on > which the jdk1.5.0_03 is installed. I found that the INSTALL documentation > seems to be in error. It states that javacomm20-x86.tar.Z (the Java > Communications API for Solaris/x86) must be used, in fact this choice led to > the following test with theBlackBox sample program in the commapi: > > root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG > BlackBox -p /dev/ttyS0 > Port /dev/ttyS0 not found! > No serial ports found! > > Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to > cause > Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to > the Eclipse stable build version 3.1M7 to avoid this. > > However, I found that using the Solaris/Sparc version of commapi > worked on my system. > > I have documented this on: > > http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 > Thanks FL. I'll change the documentation to point to the SPARC comm.jar. In the past, any Solaris was good enough, we tried to avoid the w32 comm.jar because it made native calls rxtx would never implement on any OS as they are not platform neutral. I'll withold comments about Sun's comm.jar being different on various CPUs within even the same OS. RXTX 2.1 does not need to do that even acrossed OSs for instance. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 6 10:35:43 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 11:35:43 -0500 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API Message-ID: It seems that Sun's javax.comm site does not include JavaDoc'ed API and the RxTx site has the API, but no real documentation. Is there some site that i'm just missing in my google searches? I'm looking for a copy of the javax.comm API which is documented. Thanks, nall. From taj at www.linux.org.uk Mon Jun 6 10:44:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:44:03 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > It seems that Sun's javax.comm site does not include JavaDoc'ed API > and the RxTx site has the API, but no real documentation. Is there > some site that i'm just missing in my google searches? I'm looking for > a copy of the javax.comm API which is documented. > > Thanks, > nall. Sun's version is with their binary downloads. RXTX tries to match that so I never bothered with more complete JavaDocs. Whatever Sun documents is what we try to do. -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Mon Jun 6 12:13:44 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 6 Jun 2005 14:13:44 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: Message-ID: <20050606181245.528C929D56F@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Trent Jarvi > Sent: Monday, June 06, 2005 12:44 PM > To: Jon Nall; Java RXTX discussion > Subject: Re: [Rxtx] Where can I find JavaDoc on the javax.comm API > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > It seems that Sun's javax.comm site does not include JavaDoc'ed API > > and the RxTx site has the API, but no real documentation. Is there > > some site that i'm just missing in my google searches? I'm > looking for > > a copy of the javax.comm API which is documented. > > > > Thanks, > > nall. > > Sun's version is with their binary downloads. RXTX tries to > match that so I never bothered with more complete JavaDocs. > Whatever Sun documents is what we try to do. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Try http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht ml -Ack From gadelavega at yahoo.com.ar Mon Jun 6 12:58:09 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Mon, 6 Jun 2005 15:58:09 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606181245.528C929D56F@mail.electronpusher.org> Message-ID: <20050606185809.57069.qmail@web14603.mail.yahoo.com> --- "David S. Acker" escribi?: > > -----Original Message----- > > From: rxtx-bounces at mail.electronpusher.org > > [mailto:rxtx-bounces at mail.electronpusher.org] On > Behalf Of Trent Jarvi > > Sent: Monday, June 06, 2005 12:44 PM > > To: Jon Nall; Java RXTX discussion > > Subject: Re: [Rxtx] Where can I find JavaDoc on > the javax.comm API > > > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > > > It seems that Sun's javax.comm site does not > include JavaDoc'ed API > > > and the RxTx site has the API, but no real > documentation. Is there > > > some site that i'm just missing in my google > searches? I'm > > looking for > > > a copy of the javax.comm API which is > documented. > > > > > > Thanks, > > > nall. > > > > Sun's version is with their binary downloads. > RXTX tries to > > match that so I never bothered with more complete > JavaDocs. > > Whatever Sun documents is what we try to do. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > Try > http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > ml > -Ack > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > I'm prety sure it was there... but not anymore. Gonzalo A. de la Vega, BI ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From taj at www.linux.org.uk Mon Jun 6 18:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 01:09:14 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606185809.57069.qmail@web14603.mail.yahoo.com> References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: >> http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > > I'm prety sure it was there... but not anymore. > It is there. Maybe the URL got mangled. Try this http://tinyurl.com/8dfp7 It just redirects you to: http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.html -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 7 05:46:39 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Jun 2005 07:46:39 -0400 Subject: [Rxtx] rxtx under fedora - odd procedures Message-ID: Hi All, I was able to get RXTX communications to work under Fedora, but only after I added myself to the UUCP and LOCK groups, logged out and then logged back in. Both groups appear to be needed in order to access the serial ports. Also the group alter did not take until after I logged out and logged back in. My theory is that you need permission to write to the var/spool directory under fedora and that this is the only way to do it. Logging out and logging back in just seems like an odd thing to do. I suppose some users may have to restart X. Ouch! Is this true? The alter_group command indicates that you need to be an su to alter the group database. Does this mean that my serial port users need a database su able person to use serial port applications under RXTX? If so, what is the procedure to make a transparent install work using Java web start? Should I be prompting users for the su password? Should I be telling users to exit from X and log out? Is this the way other serial communications programs work? Thanks! - Doug From sean_montgomery at baseview.com Tue Jun 7 08:14:51 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 7 Jun 2005 10:14:51 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: >>> http://java.sun.com/products/javacomm/javadocs/javax/comm/package- >>> summary.ht >>> > > >> >> I'm prety sure it was there... but not anymore. >> >> > > It is there. Maybe the URL got mangled. Try this > > http://tinyurl.com/8dfp7 > > It just redirects you to: > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > summary.html > Maybe the issue here is that the info is available without frames from that URL, but when you try to access it with frames (from the link on that page) it doesn't work - it takes you to: http://java.sun.com/products/javacomm/javadocs/index.html Which doesn't have anything useful on it. From gadelavega at yahoo.com.ar Tue Jun 7 08:22:50 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:22:50 -0300 (ART) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: Message-ID: <20050607142251.92850.qmail@web14626.mail.yahoo.com> --- "Dr. Douglas Lyon" escribi?: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the > group > alter did not take until after I logged out and > logged back in. > > My theory is that you need permission to write to > the var/spool > directory under fedora and that this is the only way > to do it. > > Logging out and logging back in just seems like an > odd thing to > do. I suppose some users may have to restart X. > Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port > applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log > out? > Is this the way other serial communications programs > work? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Actually, you need the lock group to acces /var/lock directory, and uucp to acces /dev/ttyS*. You (as root) shuold add all users you will allow to use the serial ports to group uucp and all the ones you'll allow to lock the ports to lock group (rxtx needs both). This is not only for rxtx, but for any use of the serial ports. Next time they login they'll be able to work, so if they are in they'll have to log out first. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From gadelavega at yahoo.com.ar Tue Jun 7 08:23:56 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:23:56 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> Message-ID: <20050607142356.93815.qmail@web14624.mail.yahoo.com> --- Sean Montgomery escribi?: > > On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: > > >>> > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > >>> summary.ht > >>> > > > > > >> > >> I'm prety sure it was there... but not anymore. > >> > >> > > > > It is there. Maybe the URL got mangled. Try this > > > > http://tinyurl.com/8dfp7 > > > > It just redirects you to: > > > > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > > summary.html > > > > Maybe the issue here is that the info is available > without frames > from that URL, but when you try to access it with > frames (from the > link on that page) it doesn't work - it takes you > to: > > http://java.sun.com/products/javacomm/javadocs/index.html > > Which doesn't have anything useful on it. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > That's right, my bad. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From jon.nall at gmail.com Tue Jun 7 08:33:40 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 09:33:40 -0500 Subject: [Rxtx] performance expectations Message-ID: Hi all. I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC microcontroller. The protocol I'm using (which I didn't create) looks like this for the section of code I'm concerned with: PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data PIC -> PC: 0x01 // ACK 0xNN // First 8 bits of data 0xMM // Second 8 bits of data I issue ~2000 of these Read commands. The PIC itself has an input fifo which can store 18 bytes, so I can have 18 read commands in flight at a given time. The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k 8N1. I am measuring the time it takes to perform these 2000 commands at around 30 seconds, which is much longer than I anticipated. With the link fully utilized, I expected: Time per byte transmitted: 115200 / 8 = 14400 bytes/second = ~70 uS/byte Time per response transmitted: ~70 uS/byte * 3 bytes/response = ~210 uS/response Time for 2000 responses to be transmitted: ~210 uS/response * 2000 responses = ~420ms I'm a bit new to this, so I may have made some bad asumptions, but I would have expected a time of a couple of seconds to perform the 2000 reads, not 30+ seconds. I'm obviously missing something here. Can someone help me understand what's going on? Thanks, nall. From taj at www.linux.org.uk Tue Jun 7 09:17:48 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:17:48 +0100 (BST) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the group > alter did not take until after I logged out and logged back in. > > My theory is that you need permission to write to the var/spool > directory under fedora and that this is the only way to do it. > > Logging out and logging back in just seems like an odd thing to > do. I suppose some users may have to restart X. Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log out? > Is this the way other serial communications programs work? > RIght now, rxtx requires you do one of two things. 1) Use lock files (recommended). This requires intervention by the root users to allow users to create lock files and open the ports as you note. 2) configure rxtx with --disable-lockfiles. In this case you need only worry about the permissions on /dev/ttyS* I'm not sure what the default on Fedora is with respect to permisions. This is not very attractive. There is a better way it could be done on Fedora. Fedora comes with lockdev library. I've been considering this for some time. We could use that for the locking and do away with many of the problems. The problem is embeded devices running Linux do not come with liblockdev. But for your use, I would consider adding a new option for locking serial devices using liblockdev. lockdev-devel has a man page with further information. SYNOPSIS #include pid_t dev_testlock( const char * devname); pid_t dev_lock( const char * devname); pid_t dev_relock( const char * devname, pid_t pid); pid_t dev_unlock( const char * devname, pid_t pid); cc [ flag ... ] file ... -llockdev [ library ] This would probably need to be a configure time option to prevent problems on embeded Linux devices but could otherwise be the default on Linux. I could toss a quick patch together if this is confusing. It is actually easier than what rxtx does now. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 09:27:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:27:11 +0100 (BST) Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > Hi all. > I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC > microcontroller. The protocol I'm using (which I didn't create) looks like this > for the section of code I'm concerned with: > > PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data > PIC -> PC: 0x01 // ACK > 0xNN // First 8 bits of data > 0xMM // Second 8 bits of data > > I issue ~2000 of these Read commands. The PIC itself has an input fifo which > can store 18 bytes, so I can have 18 read commands in flight at a given time. > The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k > 8N1. > > I am measuring the time it takes to perform these 2000 commands at around 30 > seconds, which is much longer than I anticipated. With the link fully utilized, > I expected: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte > > Time per response transmitted: > ~70 uS/byte * 3 bytes/response = ~210 uS/response > > Time for 2000 responses to be transmitted: > ~210 uS/response * 2000 responses = ~420ms > > I'm a bit new to this, so I may have made some bad asumptions, but I would have > expected a time of a couple of seconds to perform the 2000 reads, not 30+ > seconds. > > I'm obviously missing something here. Can someone help me understand what's > going on? > I've hooked rxtx in loopback with a scope in the past at 9600 baud (baud rate is not important). Using event notification and just writing a byte on event/read the latencey was around 8-12 ms. The JNI is not an efficient way to use native code - especially for bit banging. So if timing is critical you want to move some of the logic into the native code rather than banging over the JNI. 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your performance. C# has advantages here. If you move your logic into the native layer or use gcj (rxtx will work with that too) most of your latency should vanish. You may have to play with some sleeps in eventLoop at that point to get full native efficiency. With gcj all of rxtx becomes 'native code' as java is just treated as a subset of C++. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 09:38:51 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 10:38:51 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: On 6/7/05, Jon Nall wrote: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte of course that should be divided by 10 to account for the start/stop bits, but it barely changes the end results. From carobizar at free.fr Tue Jun 7 10:21:29 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 7 Jun 2005 18:21:29 +0200 Subject: [Rxtx] (no subject) Message-ID: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Hello ! I am a french student and I have to create an application able to read and write on serial and parallel port and to run on Windows and Linux. For the moment my program run on Windows thanks the Java Communication API (version for Microsoft Windows and Solaris/x86). But it doesn't work on Linux. Does a recent version of an installation documentation exist ? I didn't find one on the RXTX site (nothing for the windows installation and the linux installation deals with a "jcl.jar" that I don't know...). So, I have some questions : 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 version or Linux&w32 version ?) What are the differences between them ? Which of them are the most stable ? 2) Where have I to put the .so and .dll files ? 3) What have I to write on the file javax.comm.properties ? 4) Have I to delete the file win32comm.dll included in the Java Comm API ? 5) Have I to keep both comm.jar and RXTXcomm.jar ? Best regards, Caroline. From debief at telemsa.com Tue Jun 7 10:44:56 2005 From: debief at telemsa.com (DEBIEF Eric) Date: Tue, 7 Jun 2005 18:44:56 +0200 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: <200506071844.56656.debief@telemsa.com> Hi, We are "pushing" RxTx /Java here in a half-duplex link. The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC and application handling) about 25?s/byte. The figures are the barely the same on two environments. Environment 1 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Linux 2.6.3, Mdk 10.0. RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : bytes are lost on the wire. I need to investigate this mystery.... Java : 1.4.2-rc1 Blackdown Environment 2 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Windows 2000 Pro RxTx : 2.0.7. Java : 1.4.2_08 SUN I Hope this help, Eric. _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 7 11:05:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:05:45 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, DEBIEF Eric wrote: > Hi, > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. How many write() calls is this? > > Environment 1 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Linux 2.6.3, Mdk 10.0. > RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : > bytes are lost on the wire. I need to investigate this mystery.... > Java : 1.4.2-rc1 Blackdown > > Environment 2 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Windows 2000 Pro > RxTx : 2.0.7. > Java : 1.4.2_08 SUN > In my event/read/write test I found windows was ~20% faster than linux for some reason (strange part is Windows was in VMWare on the same Linux machine). It was about the same rxtx version. There are many problems with rxtx 1.4 with respect to commapi on windows but its code paths are more simple. What some people want from rxtx is perhaps better served by hacking up the very first release as they just want to read and write which is what rxtx was before Sun released commapi. It sounds like perhaps you are pushing out larger writes which will greatly improve results. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 11:16:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:16:49 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118161289.42a5c989cf6a2@imp4-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: On Tue, 7 Jun 2005 carobizar at free.fr wrote: > > Hello ! > > I am a french student and I have to create an application able to read and write > on serial and parallel port and to run on Windows and Linux. > For the moment my program run on Windows thanks the Java Communication API > (version for Microsoft Windows and Solaris/x86). > But it doesn't work on Linux. > > Does a recent version of an installation documentation exist ? > I didn't find one on the RXTX site (nothing for the windows installation and the > linux installation deals with a "jcl.jar" that I don't know...). > > So, I have some questions : > > 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 > version or Linux&w32 version ?) What are the differences between them ? Which > of them are the most stable ? > Use rxtx 2.0 with commapi for sparc solaris from Sun. If you want your current package javax.comm. > 2) Where have I to put the .so and .dll files ? On Linux just use the source, the configure script will do all of that for you. tar -xzvf rxtx-2.0-version mkdir rxtx-2.0-version/build cd rxtx-2.0-version/build ../configure && make install It will do everything for you. With Windows, you need to create the javax.comm.properties and install the DLL on your path. But you can just use Sun's package too. They are intended to be interchangable. > > 3) What have I to write on the file javax.comm.properties ? Driver=gnu.io.RXTXCommDriver More documentation in INSTALL that comes with the source. Sun's documentation should work too. configure does this for you on Linux. > > 4) Have I to delete the file win32comm.dll included in the Java Comm API ? > No > 5) Have I to keep both comm.jar and RXTXcomm.jar ? > Yes. RXTX 2.1 replaces comm.jar but the package is different (gnu.io) to avoid contaminating Sun's namespace. With rxtx 2.0 you need Sun's comm.jar - they work together. > > Best regards, > Caroline. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Tue Jun 7 12:07:34 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 14:07:34 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 Message-ID: <20050607180632.1543A29D5C8@mail.electronpusher.org> Hello, I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our product includes a built in USB to Serial adapter so that when it is connected to your PC over USB, it appears as a serial port. We had problems with Sun's comm library because it did not detect serial ports coming and going properly. I did run into a few issues with RxTx though. I am building under Windows (we support XP and 2000) under cygwin. I used a simple make file for the c code that works under cygwin and ant to build the java stuff. Attached is a diff file. The patches hit the following issues: ParallelImp.c - I am not using config so there is no config.h for me. Also, gcc didn't like a local file (win32termios.h) getting included with <> . RXTXPort.java - You can get an exception during the writeByte, writeArray, nativeDrain, readByte, read, readArray, readTerminatedArray, and nativeAvailable calls. Without this patch the IOLocked count gets stuck incremented. termios.c - If you try to open a port through CreateFile and get ERROR_ACCESS_DENIED it means someone else is using the port. We need to make sure to use serial_close instead of just close. I found that some devices finish their I/O synchronously. The code was treating this as an error. I also added some checking on the ClearError calls. I found a compile error when debugging is turned on (see the usleep change). SerialImp.c - Again, I don't have a config.h and again we must use quotes and not <> to include win32termios.h . I also commented out a report call since it seems to happen constantly on my system. Feel free to use these in any way that you want or just to ignore them. Thanks! -Dave Acker dacker at nomadio.net Software Engineer Nomadio, Inc. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diffs.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/5671d159/diffs-0397.txt From jon.nall at gmail.com Tue Jun 7 12:28:16 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 13:28:16 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, DEBIEF Eric wrote: > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. Hi. This is helpful, thanks. I can think of 2 reasons I'm not collecting the data as fast as I think I should be: 1) the device to PC connection is not at 100% utilization 2) my SerialPortEventListener processing has too much overhead Are there other explanations I might be missing as to why it takes so long to transfer the data? Thanks. nall. From taj at www.linux.org.uk Tue Jun 7 13:21:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:21:46 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > On 6/7/05, DEBIEF Eric wrote: > > We are "pushing" RxTx /Java here in a half-duplex link. > > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > > and application handling) about 25?s/byte. > > The figures are the barely the same on two environments. > > Hi. > This is helpful, thanks. I can think of 2 reasons I'm not collecting > the data as fast as I think I should be: > 1) the device to PC connection is not at 100% utilization > 2) my SerialPortEventListener processing has too much overhead > > Are there other explanations I might be missing as to why it takes so > long to transfer the data? > Polling the port would probably make more sense. You can set the threshold/timeouts to avoid racing and not deal with the event notification. As mentioned earlier I think the event latency is ~10ms. Keep the event listener around, rxtx 2.* does not close well without it. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 13:27:27 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 14:27:27 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, Trent Jarvi wrote: > Polling the port would probably make more sense. You can set the > threshold/timeouts to avoid racing and not deal with the event > notification. As mentioned earlier I think the event latency is ~10ms. Trent, Thanks for the response. Just to make sure I understand what you're talking about, when you say event latency, do you mean the time it takes from when the byte hits the PC's comm port to when rxtx presents it to user code? So if the link is 100% utilized, will my user code see "hiccups" or a steady stream of data? Thanks for helping a serial port newbie. nall. From dacker at nomadio.net Tue Jun 7 13:32:20 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 15:32:20 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <20050607193118.5499329CAA0@mail.electronpusher.org> Some folks asked about the make file and ant steps. I have JAVA_HOME set as follows: $ echo $JAVA_HOME C:\Program Files\Java\jdk1.5.0_01 I have all the code in rxtx/src put into gnu/io . The make file here doesn't have optimizations turned on. We have not tested with it yet. --------------Begin Makefile------------------ CPPFLAGS="-I$(JAVA_HOME)/include" "-I$(JAVA_HOME)/include/win32" SOBJECTS=SerialImp.o fuserImp.o termios.o fixup.o init.o POBJECTS=ParallelImp.o termios.o init.o DLLS=rxtxParallel.dll rxtxSerial.dll all: $(CLASSES) $(DLLS) rxtxSerial.dll: $(SOBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(SOBJECTS) rxtxParallel.dll: $(POBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(POBJECTS) clean: rm -fv $(SOBJECTS) $(POBJECTS) $(DLLS) %.o: %.c gcc -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< %.o: %.cpp g++ -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< --------------End Makefile------------------ Here is the ant target I use to build the rxtx libs. Our build puts the class files in a bin dir. We copy the dlls to a deploy dir and to the build dir. Eclipse seems to like the dlls in the build dir. The deploy dir is used when we build our full package. --------------Begin Ant Section------------------ --------------End Ant Section------------------ > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > David S. Acker > Sent: Tuesday, June 07, 2005 2:08 PM > To: 'Java RXTX discussion' > Subject: [Rxtx] Patches to 2.1-7pre17 > > Hello, > I am using RxTx with the Nomadio Sensor, > http://www.nomadio.net/ . Our product includes a built in > USB to Serial adapter so that when it is connected to your PC > over USB, it appears as a serial port. We had problems with > Sun's comm library because it did not detect serial ports > coming and going properly. > > I did run into a few issues with RxTx though. I am building > under Windows (we support XP and 2000) under cygwin. I used > a simple make file for the c code that works under cygwin and > ant to build the java stuff. Attached is a diff file. The > patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h > for me. Also, gcc didn't like a local file (win32termios.h) > getting included with <> . > > RXTXPort.java - You can get an exception during the > writeByte, writeArray, nativeDrain, readByte, read, > readArray, readTerminatedArray, and nativeAvailable calls. > Without this patch the IOLocked count gets stuck incremented. > > termios.c - If you try to open a port through CreateFile and > get ERROR_ACCESS_DENIED it means someone else is using the > port. We need to make sure to use serial_close instead of > just close. I found that some devices finish their I/O > synchronously. The code was treating this as an error. I > also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we > must use quotes and not <> to include win32termios.h . I > also commented out a report call since it seems to happen > constantly on my system. > > Feel free to use these in any way that you want or just to > ignore them. > Thanks! > > -Dave Acker > dacker at nomadio.net > Software Engineer > Nomadio, Inc. > From taj at www.linux.org.uk Tue Jun 7 13:37:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:37:45 +0100 (BST) Subject: [Rxtx] Re: Stack Smashing Attack In-Reply-To: <200506072012.48860.ferdinand.tatzig@web.de> References: <200506072012.48860.ferdinand.tatzig@web.de> Message-ID: On Tue, 7 Jun 2005, Ferdinand Tatzig wrote: > Dear Trent > > I am using RXTX for serial port communication between a PC and a payment > transaction terminal. > When I run my application under Windows 2000, an i386-Linux or an i386-FreeBSD > it works as I expect it to do. However, when I start it to run on AMD64 > machine with a 64-bit Gentoo Linux, the VM terminates with the following > error: > > Port found: /dev/ttyS0 > java: stack smashing attack in function configure_port() > > I am using a 64-bit Blackdown-1.4.2-01 VM. > > I have searched the internet but have found no information about this error. > > This is the code of the method which initializes the serial port: > > /** > * initializes a serial port for communication with a terminal; only > * accessible within this class > * > * @param communication > * @param serialPortToBeInitialized > * @param tillInterfaceEventListener > */ > private TillInterfaceSerialPort(Communication communication, > String serialPortToBeInitialized, > TillInterfaceEventListener tillInterfaceEventListener) > throws IOException, PortInUseException, > TillInterfaceSerialPortNotFoundException, > TooManyListenersException, UnsupportedCommOperationException { > serialPortName = "not initialized yet"; > CommPortIdentifier portId = null; > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > boolean portFound = false; > String temporarySerialPortName = "not initialized yet"; > > // look for a serial port > while (portList.hasMoreElements() && !portFound) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > temporarySerialPortName = portId.getName(); > if (temporarySerialPortName.equals(serialPortToBeInitialized)) { > System.out.print("Port found: "); > System.out.println(temporarySerialPortName); > serialPortName = temporarySerialPortName; > portFound = true; > } > } > } > if (portFound) { > > // initialize the found port - this command causes the VM to terminate > serialPort = (SerialPort) portId > .open( > TillInterfaceConstants.APPLICATION_NAME, > TillInterfaceConstants > .TIMEOUT_IN_MILLISECONDS_FOR_OPENING_OF_COMMUNICATION_PORT); > > // add an event listener which listens > // on the serial port and notifies the > // serial port object when input bytes > // have been received at the port > serialPort.addEventListener(tillInterfaceEventListener); > serialPort.notifyOnDataAvailable(true); > > // initialize the physical layer > // parameters of the serial port > serialPort.setSerialPortParams(TillInterfaceConstants.BAUD_RATE, > SerialPort.DATABITS_8, SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > // set the inter-character > // timeout (T2) > serialPort > .enableReceiveTimeout(TillInterfaceConstants.INTERCHARACTER_TIMEOUT_IN_MILLISECONDS); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > } else > throw new TillInterfaceSerialPortNotFoundException(); > } > > Any hint to solve this problem would be kindly appreciated. > The only thing that comes to mind here after looking at the offending function is rxtx used to include asm/termios.h but now we moved to termios.h and had glibc fix their headers. The asm/termios.h caused problems as its termios was smaller than the actual termios. This should be fixed in current rxtx versions but you can just glance at SerialImp.c and make sure it does not include asm/termios.h. I've cc'd the rxtx mail list because there was one other mention of stack problems recently. I have used rxtx on opteron systems with success. I have a bug I'm trying hard to reproduce on suse 64 bit (circa linux 2.4.19) systems though. So far I have not been able to reproduce the bug. That said, with gentoo... I like gentoo but I seriously doubt they do any QA with their kernel and Java. I've seen problems before. If you use gentoo and have Java problems, at least stick to Linus (that is an s there) kernels while using Java. I'm not an expert on gentoo but I've seen patches go into experimental kernels that turn out to break java and are reverted before going to Linus just before I see problems with gentoo on this list. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:16:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:16:14 +0100 (BST) Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: On Tue, 7 Jun 2005, David S. Acker wrote: > Hello, > I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our > product includes a built in USB to Serial adapter so that when it is > connected to your PC over USB, it appears as a serial port. We had problems > with Sun's comm library because it did not detect serial ports coming and > going properly. > > I did run into a few issues with RxTx though. I am building under Windows > (we support XP and 2000) under cygwin. I used a simple make file for the c > code that works under cygwin and ant to build the java stuff. Attached is a > diff file. The patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h for me. Also, > gcc didn't like a local file (win32termios.h) getting included with <> . > > RXTXPort.java - You can get an exception during the writeByte, writeArray, > nativeDrain, readByte, read, readArray, readTerminatedArray, and > nativeAvailable calls. Without this patch the IOLocked count gets stuck > incremented. > > termios.c - If you try to open a port through CreateFile and get > ERROR_ACCESS_DENIED it means someone else is using the port. We need to > make sure to use serial_close instead of just close. I found that some > devices finish their I/O synchronously. The code was treating this as an > error. I also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we must use quotes > and not <> to include win32termios.h . I also commented out a report call > since it seems to happen constantly on my system. > > Feel free to use these in any way that you want or just to ignore them. > Thanks! > Hi Dave These patches look great as is. Thanks. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:33:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:33:16 +0100 (BST) Subject: [Rxtx] Patch to IOLocked (fwd) Message-ID: This appears to be another solution to the locking. Chris, the other option just moves the locking into the finally clause which I think would be a little cleaner though I'm posting this patch to so people can comment. -- Trent Jarvi tjarvi at qbang.org ---------- Forwarded message ---------- Date: Wed, 1 Jun 2005 13:01:32 +0100 From: Christopher Dawes To: taj at www.linux.org.uk Subject: Patch to IOLocked Do you want me to check it out of CVS and then submit changes? Christopher -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXPort.java.diff Type: application/octet-stream Size: 6965 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/c442f9fc/RXTXPort.java-0400.obj From Christopher.Dawes at retail-logic.com Wed Jun 8 00:57:24 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 8 Jun 2005 07:57:24 +0100 Subject: [Rxtx] Patch to IOLocked (fwd) [Virus Checked] In-Reply-To: Message-ID: Agreed, much better Java :-) Thanks Christopher ------------------------------------------- Consultant Engineer Retail Logic Limited Fleet GU51 3TZ Tel: +44 (0)1252 644377 Mob: +44 (0)7899 842759 Fax: +44 (0)1252 776708 rxtx-bounces at mail.electronpusher.org wrote on 07/06/2005 21:33:16: > > This appears to be another solution to the locking. Chris, the other > option just moves the locking into the finally clause which I think would > be a little cleaner though I'm posting this patch to so people can > comment. > > -- > Trent Jarvi > tjarvi at qbang.org > > ---------- Forwarded message ---------- > Date: Wed, 1 Jun 2005 13:01:32 +0100 > From: Christopher Dawes > To: taj at www.linux.org.uk > Subject: Patch to IOLocked > > Do you want me to check it out of CVS and then submit changes? > > Christopher[attachment "RXTXPort.java.diff" deleted by Chris > Dawes/Retaillogic/NISABA] _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx From zempftman at gmail.com Wed Jun 8 07:57:25 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 09:57:25 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Maxwell Zempftman Date: May 27, 2005 5:01 PM Subject: Re: [Rxtx] Kaffe & rxtx & armv5b To: rxtx at mail.linuxgrrls.org Here are the results from working this week: The "NullPointerExceptions" are generated by the software when I choose a bad device file. I discovered that this occurs on the i686-RedHat box as well. This exception seems to be generated only by this particular application, and not by the example programs in contrib. So, for example: java MyApp /dev/null <-- generates NullPointerException java MyApp fake <-- generates NullPointerException java MyApp /dev/ttyS0 <-- does not generate NullPointerException Using the program CommCheck (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it appears as though /dev/ttyS0 is the only valid serial device file on the XScale device, so the errors I was getting are not really be bugs. Although /dev/ttyS0 did not generate NullPointerExceptions, I did encounter this error: --start java MyApp /dev/ttyS0 (going mostly from memory, not exact) PortList.hasMoreElements: true Listening on: /dev/ttyS0 Client connected. >From net: echo kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 vmExcept_setJNIFrame Assert: on 'fp != 0' failed. --end I took a look at exception.h, and it seems as though the problematic code does not exist in newer versions of Kaffe (I have been using CVS-2004-11). Next week I will try to use a newer version, although so far everything but CVS-2004-11 has failed. Also, I the device files I need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with something like this? Thanks, Max. > On 5/21/05, Trent Jarvi wrote: > > I'm not sure what is wrong in the first part. It sounds like your > > application may be swallowing an exception while trying to enumerate the > > port or open it. The usual mistake made it not having permissions to > > either open the port or create the lockfile. There should be examples in > > the contrib directory you can try that enumerate and open ports. Maybe > > that will give you some hints. > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > Sun's code limiting you there though you do need to compile and install > > rxtx for the XScale with Sun's Commapi. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > From taj at www.linux.org.uk Wed Jun 8 08:22:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 15:22:44 +0100 (BST) Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > ---------- Forwarded message ---------- > From: Maxwell Zempftman > Date: May 27, 2005 5:01 PM > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > To: rxtx at mail.linuxgrrls.org > > > Here are the results from working this week: > > The "NullPointerExceptions" are generated by the software when I > choose a bad device file. I discovered that this occurs on the > i686-RedHat box as well. This exception seems to be generated only by > this particular application, and not by the example programs in > contrib. So, for example: > > java MyApp /dev/null <-- generates NullPointerException > java MyApp fake <-- generates NullPointerException > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > Using the program CommCheck > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > appears as though /dev/ttyS0 is the only valid serial device file on > the XScale device, so the errors I was getting are not really be bugs. > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > encounter this error: > > --start > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > PortList.hasMoreElements: true > Listening on: /dev/ttyS0 > Client connected. > >From net: echo > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > --end > > I took a look at exception.h, and it seems as though the problematic > code does not exist in newer versions of Kaffe (I have been using > CVS-2004-11). Next week I will try to use a newer version, although so > far everything but CVS-2004-11 has failed. Also, I the device files I > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > something like this? > In RXTXCommDriver, just look for the following code and add /dev/ttyM to the list. Moxa? if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } So: if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyM", // for Moxa ports "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } Linux just has way too many port types to try enumerating them all. There is potential we can add them back in with udev now. > Thanks, > Max. > > > On 5/21/05, Trent Jarvi wrote: > > > I'm not sure what is wrong in the first part. It sounds like your > > > application may be swallowing an exception while trying to enumerate the > > > port or open it. The usual mistake made it not having permissions to > > > either open the port or create the lockfile. There should be examples in > > > the contrib directory you can try that enumerate and open ports. Maybe > > > that will give you some hints. > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > Sun's code limiting you there though you do need to compile and install > > > rxtx for the XScale with Sun's Commapi. > > > > > > -- > > > Trent Jarvi > > > tjarvi at qbang.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Wed Jun 8 12:16:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 08 Jun 2005 13:16:03 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A60B8D.8080500@cs.umn.edu> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> Message-ID: <42A735E3.8040706@atcorp.com> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual serial comport. This isn't so much of a problem, what is, however, is that the comport does not appear to be able to be set to any arbitrary speed, only those from the data_rate enum. I've not found much on using different speeds, has anyone else encountered anything similar? I greatly appreciate any and all comments and suggestions. Thanks in advance, ~ Shawn Lavelle From zempftman at gmail.com Wed Jun 8 12:50:58 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 14:50:58 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: Thanks Trent! That will solve one of the problems. I don't know when my next chance to work on it will be, but I still need to figure out the error I got when I tried opening '/dev/ttyS0' on the Moxa device regarding a failed assertion, seemed to be a Kaffe issue. Thanks for you help, hope to have results soon, Max Englander. On 6/8/05, Trent Jarvi wrote: > On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > > > ---------- Forwarded message ---------- > > From: Maxwell Zempftman > > Date: May 27, 2005 5:01 PM > > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > > To: rxtx at mail.linuxgrrls.org > > > > > > Here are the results from working this week: > > > > The "NullPointerExceptions" are generated by the software when I > > choose a bad device file. I discovered that this occurs on the > > i686-RedHat box as well. This exception seems to be generated only by > > this particular application, and not by the example programs in > > contrib. So, for example: > > > > java MyApp /dev/null <-- generates NullPointerException > > java MyApp fake <-- generates NullPointerException > > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > > > Using the program CommCheck > > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > > appears as though /dev/ttyS0 is the only valid serial device file on > > the XScale device, so the errors I was getting are not really be bugs. > > > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > > encounter this error: > > > > --start > > > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > > > PortList.hasMoreElements: true > > Listening on: /dev/ttyS0 > > Client connected. > > >From net: echo > > > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > > > --end > > > > I took a look at exception.h, and it seems as though the problematic > > code does not exist in newer versions of Kaffe (I have been using > > CVS-2004-11). Next week I will try to use a newer version, although so > > far everything but CVS-2004-11 has failed. Also, I the device files I > > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > > something like this? > > > > > In RXTXCommDriver, just look for the following code and add /dev/ttyM to > the list. Moxa? > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > So: > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyM", // for Moxa ports > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > Linux just has way too many port types to try enumerating them all. There > is potential we can add them back in with udev now. > > > > > Thanks, > > Max. > > > > > On 5/21/05, Trent Jarvi wrote: > > > > I'm not sure what is wrong in the first part. It sounds like your > > > > application may be swallowing an exception while trying to enumerate the > > > > port or open it. The usual mistake made it not having permissions to > > > > either open the port or create the lockfile. There should be examples in > > > > the contrib directory you can try that enumerate and open ports. Maybe > > > > that will give you some hints. > > > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > > Sun's code limiting you there though you do need to compile and install > > > > rxtx for the XScale with Sun's Commapi. > > > > > > > > -- > > > > Trent Jarvi > > > > tjarvi at qbang.org > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- > Trent Jarvi > tjarvi at qbang.org > From taj at www.linux.org.uk Wed Jun 8 12:53:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 19:53:10 +0100 (BST) Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A735E3.8040706@atcorp.com> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: On Wed, 8 Jun 2005, Shawn Lavelle wrote: > Hello, > I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate > with a virtual serial comport. This isn't so much of a problem, what > is, however, is that the comport does not appear to be able to be set to > any arbitrary speed, only those from the data_rate enum. I've not found > much on using different speeds, has anyone else encountered anything > similar? I greatly appreciate any and all comments and suggestions. > This problem is a bit more tricky than it should be. POSIX systems just have a few specified baud rates. Solaris is one of these systems. CommAPI baud rates probably came from someone looking at Solaris. RXTX tries to be POSIX like. W32 is treated as a POSIX like system via a termios.c file in rxtx. Serial ports have baudbase and divisor. So you can set these to come close to the baudrate you want. Some funky equipment like automobile test equipment use baud rates that are not really possible with PC hardware. But if you get as close as possible by changing baud base and divisor, it works. Windows can actually do this for you. I don't know exactly what their code does but if you pass a baudrate to windows, it will guestimate a baudbase and divisor. So you just pass it 10200 baud and it does its job. This is not of very much use the way rxtx does things though. Linux has the standard POSIX like baud rates but if you set the baud rate to B38400, you can set your own baud base and divisor. This is not POSIX that I know of. W32 has more capability than POSIX like systems too. So I did some work to have windows work like Linux via termios.c But the code is not quit right. SerialImp.c and termios.c need some work so all the various buadrates work on Linux and W32. Most other systems will not work beyond what CommAPI already specifies without writting kernel drivers. This is on my todo list but if someone gets to it first, all the better. -- Trent Jarvi tjarvi at qbang.org From carobizar at free.fr Thu Jun 9 06:39:10 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Thu, 9 Jun 2005 14:39:10 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: <1118320750.42a8386e6d3ce@imp5-q.free.fr> Hi ! Thank you for all your advices. I managed to use rxtx on Windows but I have still some difficulties on Linux. I have yet follow your instructions and the configure file has created : - librxtxSerial.so and librxtxParallel.so in the directory /usr/java/j2sdk1.4.2_08/jre/lib/i386 - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the directory /usr/java/j2sdk1.4.2_08/jre/lib - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext But when I run my program, Some exceptions occur : Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver So, 1) What have I forgotten ? 2) Is it possible to make my application run on Linux without the jdk (only the jre) ? Best regards, Caroline. From taj at www.linux.org.uk Thu Jun 9 07:28:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 9 Jun 2005 14:28:05 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118320750.42a8386e6d3ce@imp5-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: On Thu, 9 Jun 2005 carobizar at free.fr wrote: > Hi ! > Thank you for all your advices. > I managed to use rxtx on Windows but I have still some difficulties on Linux. > I have yet follow your instructions and the configure file has created : > - librxtxSerial.so and librxtxParallel.so in the directory > /usr/java/j2sdk1.4.2_08/jre/lib/i386 > - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the > directory /usr/java/j2sdk1.4.2_08/jre/lib > - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext > > But when I run my program, Some exceptions occur : > Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while > loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > com.sun.comm.SolarisDriver > > So, > 1) What have I forgotten ? > The native (.so) libraries are not installed in a directory the JRE is looking for native libraries in. You may look around and see where the .so libraries are in the JRE. I don't know that the jre/lib/i386 directory is specified as a required directory for JREs. I noticed some do not use it. You may try printing the java.libarary.path to see your options. It is also possible to alter the java.library.path. > 2) Is it possible to make my application run on Linux without the jdk (only the > jre) ? Yes. Though installation from source with the JDK is less error prone. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0397.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 7 15:03:09 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 07 Jun 2005 16:03:09 -0500 Subject: [Rxtx] Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <42A60B8D.8080500@cs.umn.edu> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual comport. This isn't so much of a problem, what is, however, is that the comport is only ever set to 9600 baud. I've not found this as a documented bug, has anyone else encountered anything similar? I'll try and provide more detail tomorrow, but if anyone has any suggestions or encountered this before, I'd like to hear about it. Thanks in advance, ~ Shawn Lavelle From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0400.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0400.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0400.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Mon Jun 20 01:04:40 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 20 Jun 2005 08:04:40 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: <42B66A88.4060806@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050620/9be208a1/attachment-0400.html From fbalzarro at libero.it Mon Jun 20 02:33:52 2005 From: fbalzarro at libero.it (Fabio Balzarro) Date: Mon, 20 Jun 2005 10:33:52 +0200 Subject: [Rxtx] RXTXPort:close detected bad file descriptor Message-ID: I'm using RXTX libraries on IPAQ 4150 PDA with Windows CE 4.20 and Jeode. When I close a serial port with sp.close() (where sp is a SerialPort) sometimes an error occour 1119256168085: RXTXPort:close detected bad file descriptor What can I do? Thanks Fabio ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From slavelle at atcorp.com Mon Jun 20 08:08:19 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 20 Jun 2005 09:08:19 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: <42B6CDD3.4040409@atcorp.com> It turns out that I did have a driver-not-used issue which has now been resolved and I can use RxTx on it (had to add ttyUSB as a valid port), but only at standard baud rates. Does USB have the same restrictions on port speed as regular RS232? ~ Shawn Trent Jarvi wrote: > Just a note here. > > I have requested a FTDI usb device and they offered to send one for the > purpose of trying to get rxtx working. I have no idea how long that takes > though. > > > On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > > >>I'm afraid we're just using the latest version from the FTDI website. I've >>not yet played with linux properly with this and unfortunately I run gentoo >>and haven't yet successfully compiled in the ftdi driver. I'll let you know >>if I get any success. >> >>Appologies >> >>Christopher >> >>-----Original Message----- >>From: rxtx-bounces at mail.electronpusher.org >>[mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle >>Sent: 15 June 2005 00:00 >>To: Java RXTX discussion >>Subject: Re: [Rxtx] Virtual Com Ports >> >>Hmm, the latter sounds like a lot of work. It does find the virtual comport >>in windows, i must have just missed it earlier (sign of a long day). On the >>linux side, I suspect that something is not correct with the driver >>installation becuase it does not give me a tty for it :( >> >>Christopher, May I ask what driver you are using for your FTDI chip? >>Did you ever encounter problems with not getting a tty assigned for it? >> >> >> Thanks for all your help! >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>They will have to show up as a tty device in Linux. Probably ttyUSB? >>>That will need an entry in RXTXCommDriver.java. If they dont show up >>>as a tty device, rxtx cant treat it like a serial port. It just wont >> >>work. >> >>>With COM3, rxtx will try to open the port and perform a timed out read. >>>Usually if a port is not there, the read blows up or the open blows up. >>>Timing out is fine. COM3 used to share interrupts with COM1. I know >>>you can reassign ports in XP. RXTX scans up through COM255. You may >>>try moving it. >>> >>> >>>The code in question is the following in RXTXCommDriver.java >>> >>> >>> if(osName.equals("Linux")) >>> { >>> String[] Temp = { >>> "ttyS", // linux Serial Ports >>> "ttySA", // for the IPAQs >>> "ttyUSB" // for USB frobs >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>> else if(osName.toLowerCase().indexOf("windows") != -1 ) >>> { >>> String[] Temp = { >>> "COM" // win32 serial ports >>> //"//./COM" // win32 serial ports >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>>If COM3 can be read, it should be found. the ttyUSB should work if >>>thats in the version of RXTXCommDriver.java you have. >>> >>>If this is still a problem, it may be that the driver is erroring on >>>what may be considered normal comm port operations such as setting the >>>speed, timeout, threshold, .. One would have to start looking at each >>>function called in the native open() and read(). >>> >>> >>> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>>seems to find the device using rxtx. Looking at the hardware >>>>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>>>linux. I can't seem to get it to show up as a tty(s#) in linux which >>>>is probably just due to my lack of significant linux knowledge. >>>> >>>> ~ Shawn >>>> >>>>Trent Jarvi wrote: >>>> >>>> >>>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>Has anyone here noticed that virtual comports do not get enumerated >>>>>>via CommPortIdentifier.getPortIdentifiers()?? >>>>>> >>>>>>The device I'm trying to talk to uses an fdti usb to serial >>>>>>convertor with a driver that has it show up as a virtual comport. I >>>>>>can enter this port manually and it will be usable but I cannot get >>>>>>it show up automatically (as in the simple serial demo). Any thoughts >> >>on this? >> >>>>> >>>>>Hi Shawn, >>>>> >>>>>What OS is this and what is the name of the virtual port you are >>>>>trying to open? I suspect the name just needs to be added to >> >>RXTXCommDriver.java. >> >>>>_______________________________________________ >>>>Rxtx mailing list >>>>Rxtx at mail.electronpusher.org >>>>http://www.electronpusher.org/mailman/listinfo/rxtx >>>> >>> >>> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From lyon at docjava.com Mon Jun 20 15:06:08 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 20 Jun 2005 17:06:08 -0400 Subject: [Rxtx] testing Message-ID: Hi All, I am testing my new multi-platform Java Webstart RXTX application (Trent: I could not have done it without you!). So far, I think it will work under Linux (x86), Windows XP, Windows 2000 and MacOS X. The application is available as a Java webstart application at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Edit:Preferences: SerialPort Setup... should bring up a dialog box that enables dialing via the modem. Generally, it does not find internal modems (except on the mac). Why, I don't know. Thanks in advance for trying this new app. All feedback on it is welcome. - Doug Lyon From jasmine at electronpusher.org Tue Jun 21 04:15:53 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Tue, 21 Jun 2005 11:15:53 +0100 Subject: [Rxtx] testing In-Reply-To: References: Message-ID: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > Hi All, > I am testing my new multi-platform Java Webstart RXTX application > (Trent: I could not have done it without you!). > > So far, I think it will work under Linux (x86), Windows XP, > Windows 2000 and MacOS X. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. -J. From taj at www.linux.org.uk Tue Jun 21 05:50:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 12:50:23 +0100 (BST) Subject: [Rxtx] testing In-Reply-To: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> References: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> Message-ID: On Tue, 21 Jun 2005, Jasmine Strong wrote: > > On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > > > Hi All, > > I am testing my new multi-platform Java Webstart RXTX application > > (Trent: I could not have done it without you!). > > > > So far, I think it will work under Linux (x86), Windows XP, > > Windows 2000 and MacOS X. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > on my Mac. > passing -source 1.3 -target 1.3 to javac will compile classes without this problem. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 10:19:25 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 11:19:25 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. Sincerely, Jeremyah Payne From ricardo.trindade at emation.pt Tue Jun 21 13:25:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 20:25:00 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B8698C.2060509@emation.pt> Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > From taj at www.linux.org.uk Tue Jun 21 13:39:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:39:43 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <42B8698C.2060509@emation.pt> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> <42B8698C.2060509@emation.pt> Message-ID: It looks like he has an rs422 device/converter. This is not the problematic 'trying to do protocol X with a serial port' situation unless I'm missing something. I'll follow up with the other email I started. On Tue, 21 Jun 2005, Ricardo Trindade wrote: > Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. > > Payne, Jeremyah L (N-CIM) wrote: > > >Good morning, my name is Jeremyah and I am working on a java project to > >interface with some devices. In short, I have a laptop with a PCMIA > >converter that does RS422 running windows 2000. I also will be > >installing some PCI cards into some Linux boxes that will have probably > >4-8 RS422 ports on them. After doing some reading in order to talk > >with these items using my existing java code I will need an additional > >driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > >trying to get a map sort of where I need to make changes. As I see it, > >I would need to subclass SerialPort to my RS422 interface. That would > >link with a DLL or SO implementation that talks with the hardware. I > >also need to change the listing of working ports in the lookup section > >for serial. Does this seem like I am on the right track? Appreciate > >the support. > > > > > >Sincerely, > >Jeremyah Payne > >_______________________________________________ > >Rxtx mailing list > >Rxtx at mail.electronpusher.org > >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 21 13:40:25 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:40:25 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: On Tue, 21 Jun 2005, Payne, Jeremyah L (N-CIM) wrote: > Good morning, my name is Jeremyah and I am working on a java project to > interface with some devices. In short, I have a laptop with a PCMIA > converter that does RS422 running windows 2000. I also will be > installing some PCI cards into some Linux boxes that will have probably > 4-8 RS422 ports on them. After doing some reading in order to talk with > these items using my existing java code I will need an additional > driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > trying to get a map sort of where I need to make changes. As I see it, I > would need to subclass SerialPort to my RS422 interface. That would link > with a DLL or SO implementation that talks with the hardware. I also > need to change the listing of working ports in the lookup section for > serial. Does this seem like I am on the right track? Appreciate the > support. > Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 13:40:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 14:40:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618954@emss02m08.us.lmco.com> I'd like to except I am dealing with NASA. I am basically building a system to monitor 100+ Units that communicate over RS422. They have some converters in place but want to get rid of them. I'll check through the archives. I had started looking yesterday as was leaving work. -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Ricardo Trindade Sent: Tuesday, June 21, 2005 2:25 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From slavelle at atcorp.com Tue Jun 21 14:58:06 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 21 Jun 2005 15:58:06 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: <42B87F5E.4000403@atcorp.com> > Linux has the standard POSIX like baud rates but if you set the baud rate > to B38400, you can set your own baud base and divisor. This is not POSIX > that I know of. W32 has more capability than POSIX like systems too. So > I did some work to have windows work like Linux via termios.c > > But the code is not quit right. SerialImp.c and termios.c need some > work so all the various buadrates work on Linux and W32. Most other > systems will not work beyond what CommAPI already specifies without > writting kernel drivers. > > This is on my todo list but if someone gets to it first, all the better. Hmm, I guess I didn't read this close enough before. Just to be clear, the pieces to setBaudBase and setDivisor are not yet implemented, correct? Thanks, Shawn From sean_montgomery at baseview.com Tue Jun 21 15:14:08 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 21 Jun 2005 17:14:08 -0400 Subject: [Rxtx] OS X installation - file locations Message-ID: <8AB82C7F-0D19-45F9-AE54-A12C59A8495E@baseview.com> Greetings, I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) using the RXTX installation instructions. RXTX worked fine. Basically you've got: - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions - javax.comm.properties in /System/Library/Frameworks/ JavaVM.framework/Home/lib - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ lib/ext My coworker was concerned that the installation required files to be placed in /System/Library... because those directories are "Apple's" and subject to change at Apple's whim, and that it would be safer (less likely to break when a user updates their OS or Java version or what have you) if all the files could be somewhere in /Library... or / Library/Java. My coworker points out that when 3rd party apps like FrontBase and JBoss need to communicate with Java their jars are placed in /Library/Java/Extensions. Granted that RXTX 2.0 is implementing javax.comm and not just a 3rd party extension, might that be the case - that javax.* stuff needs to be in the Java system files? I'm not the Java maven that my coworker is, so I don't know if any of this is gospel or not. Any OS X/Java experts out there willing to comment? We'd like to be able to install RXTX in the safest, most maintenance free way possible, but if there are specific reasons why javax.comm.properties and comm.jar need to be in /System... then so be it. Any information is welcome, Sean From ricardo.trindade at emation.pt Tue Jun 21 15:56:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 22:56:53 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B88D25.7060604@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050621/f6c9f5fe/attachment-0400.html From jeremyah.l.payne at lmco.com Tue Jun 21 15:22:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 16:22:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618955@emss02m08.us.lmco.com> -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Trent Jarvi Sent: Tuesday, June 21, 2005 2:40 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 As of yet we have not decided on the PCI boards to use yet So I am still waiting to se how we will interface to them. But the laptop is ready to use so ill build a test app for that API for now. The overview of class structure is really what I needed. I guess I will use the 2.1 as you suggested. Thanks for the help thus far! BTW, you guys wouldn't happen to keep class diagrams or anything of that nature around would you? If not I will probably end up having to do some anyway for documentation purposes, I could include them. Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From dmarkman at mac.com Tue Jun 21 18:13:28 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 21 Jun 2005 20:13:28 -0400 Subject: [Rxtx] OS X installation - file locations In-Reply-To: References: Message-ID: <044F520C-585C-4B99-82ED-3BA83DB8CE77@mac.com> Apple doesn't recommend to put jars into the /System/Library/Frameworks/JavaVM.framework/Home/lib/ext folder from other hands it's standard java directory to put extentions if you want to support comm api on whole system then I'd recommend to put jars into the /Library/Java/Extensions folder just like you did if you want to support comm api per user put your jars into the ~/ Library/Java/Extensions On Jun 21, 2005, at 5:14 PM, Java RXTX discussion wrote: > Greetings, > > > I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) > using the RXTX installation instructions. RXTX worked fine. > > > Basically you've got: > - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions > - javax.comm.properties in /System/Library/Frameworks/ > JavaVM.framework/Home/lib > - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ > lib/ext > > > My coworker was concerned that the installation required files to be > placed in /System/Library... because those directories are "Apple's" > and subject to change at Apple's whim, and that it would be safer > (less likely to break when a user updates their OS or Java version or > what have you) if all the files could be somewhere in /Library... or / > Library/Java. My coworker points out that when 3rd party apps like > FrontBase and JBoss need to communicate with Java their jars are > placed in /Library/Java/Extensions. Granted that RXTX 2.0 is > implementing javax.comm and not just a 3rd party extension, might > that be the case - that javax.* stuff needs to be in the Java system > files? > > > I'm not the Java maven that my coworker is, so I don't know if any of > this is gospel or not. Any OS X/Java experts out there willing to > comment? We'd like to be able to install RXTX in the safest, most > maintenance free way possible, but if there are specific reasons why > javax.comm.properties and comm.jar need to be in /System... then so > be it. > > > Any information is welcome, > > > Sean > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Dmitry Markman Dmitry Markman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050622/beea65d0/attachment-0400.html From lyon at docjava.com Thu Jun 23 04:39:47 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 23 Jun 2005 06:39:47 -0400 Subject: [Rxtx] web start + RXTX = strange errors? Message-ID: On: Date: Tue, 21 Jun 2005 11:15:53 +0100 From: Jasmine Strong Writes: An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. ----------- I cannot duplicate your error. My version of Java is: java -version java version "1.4.2_05" Is yours the same? Trent: You wrote: passing -source 1.3 -target 1.3 to javac will compile classes without this problem. ----------- OK, I have updated the disto to work with jdk1.3: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Jasmine: Is this working any better? Thanks! - DL From handzisk at tkn.tu-berlin.de Fri Jun 24 02:37:14 2005 From: handzisk at tkn.tu-berlin.de (Vlado Handziski) Date: Fri, 24 Jun 2005 10:37:14 +0200 (CEST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace Message-ID: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Hi all, let me first express my compliments on the great work you have done with the RXTX library. We have been using the library for some time, and we are at a point where we want to make our code public. For legacy reasons, the code that the RXTX library is bundled with, uses the javax.comm namespace. We have been using the ChangePackage script to change the RXTX2.1 package from gnu.io into javax.comm. We need the independent implementation since we want to be able to directly access /dev/ttyUSBx ports in linux and the CommAPI versions are just not as stable. On the download page, there is a comment that this is in violation of sun's license. Can someone shed more light on this. I was not aware that you can protect the names of the java packages. Best regards, Vlado From ricardo.trindade at emation.pt Fri Jun 24 04:01:17 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 11:01:17 +0100 Subject: [Rxtx] parity missed Message-ID: <42BBD9ED.3060004@emation.pt> Hi, I have a "parity missed error". From previous posts I believe this has to do with CMSPAR not being defined. I checked out 2.1 head from CVS. How can I make sure I do a proper build and CMSPAR is defined ? Perhaps it would be good to have a release snapshot that has this, I think the latest snapshot (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. Another question I have, is why must this depend on kernel headers, why can't it be defined in the RXTX source ? thanks Ricardo From jasmine at electronpusher.org Fri Jun 24 04:09:06 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 24 Jun 2005 11:09:06 +0100 Subject: [Rxtx] web start + RXTX = strange errors? In-Reply-To: References: Message-ID: <644aad2bdbba950f0a2fb12d7dcfd8a6@electronpusher.org> On 23 Jun 2005, at 11:39, Dr. Douglas Lyon wrote: > OK, I have updated the disto to work with jdk1.3: > http://show.docjava.com:8086/book/cgij/code/jnlp/ > addbk.JAddressBook.Main.jnlp > > Jasmine: Is this working any better? Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) -J. From taj at www.linux.org.uk Fri Jun 24 10:54:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 17:54:12 +0100 (BST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: On Fri, 24 Jun 2005, Vlado Handziski wrote: > Hi all, > > let me first express my compliments on the great work you have done with > the RXTX library. > > We have been using the library for some time, and we are at a point where > we want to make our code public. For legacy reasons, the code that the > RXTX library is bundled with, uses the javax.comm namespace. We have been > using the ChangePackage script to change the RXTX2.1 package from gnu.io > into javax.comm. We need the independent implementation since we want to > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > versions are just not as stable. > > On the download page, there is a comment that this is in violation of > sun's license. Can someone shed more light on this. I was not aware that > you can protect the names of the java packages. > > Best regards, > Vlado > I can't provide legal advice as I am not a lawyer. (v) may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are contained in the "java", "javax" or "sun" packages or similar as specified by Sun in any class file naming convention; and The license is in the commapi package from Sun. The above is also in all the EULA's you click through to download from Sun if I'm not mistaken. Simply put, the license taints developers that agree to it. For those developers, Sun has control of the javax.comm namespace. It really does not make sense to put rxtx 2.1 in the javax.comm namespace. It will only cause confusion which I think is the point of the clause above. The gnu.io namespace was perhaps a poor choice and just tossed in when reviewing the license to get out of Sun's namespace. There is nothing in the rxtx license limiting your freedom in this fashion though. Many companies are moving to gnu.io and some distribute it with popular applications you would recognize. I'm tempted to ask you not to contaminate rxtx 2.1 with the javax.comm namespace. You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) extensions to existing classes (which I dont think you are using); it is not just javax.comm. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 24 13:24:09 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 20:24:09 +0100 (BST) Subject: [Rxtx] parity missed In-Reply-To: <42BBD9ED.3060004@emation.pt> References: <42BBD9ED.3060004@emation.pt> Message-ID: On Fri, 24 Jun 2005, Ricardo Trindade wrote: > Hi, > > I have a "parity missed error". From previous posts I believe this > has to do with CMSPAR not being defined. > I checked out 2.1 head from CVS. How can I make sure I do a proper > build and CMSPAR is defined ? Perhaps it would be good to have a release > snapshot that has this, I think the latest snapshot > (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. > > Another question I have, is why must this depend on kernel headers, > why can't it be defined in the RXTX source ? > I used to cheat and grab the CMSPAR from the kernel headers because glibc did not have it. Now rxtx uses the glibc headers and we have a patch in glibc I trust that handles this. It would not be right to override glibc and it wasnt right to use the kernel headers (it really did cause problems). You can override glibc for now with the following in the top of SerialImp.c # define CMSPAR 010000000000 You can check if your distro headers have this right bit looking for the above in bits/termios.h. It should look like this: #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif If it is not defined, please file a bug with your distro as rxtx is not the only thing that will be broken on that distro. I was going to release new cvs snapshots last weekend but got tied up. I'll do it this weekend. I also need to get custom baudrate patches into the cvs snapshot. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Fri Jun 24 13:56:50 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 20:56:50 +0100 Subject: [Rxtx] parity missed In-Reply-To: References: <42BBD9ED.3060004@emation.pt> Message-ID: <42BC6582.2070805@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050624/e3b39631/attachment-0400.html From vlado.handziski at gmail.com Sat Jun 25 06:25:52 2005 From: vlado.handziski at gmail.com (Vlado Handziski) Date: Sat, 25 Jun 2005 14:25:52 +0200 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: <697986ec05062505256ebf381f@mail.gmail.com> Thanks for the clarification. Since changing the bundled source is not an option at this moment, we will consider using javax.comm and RXTX2.0. In the next rewrite, we would probably move to gnu.io . Best regards, Vlado Handziski On 6/24/05, Trent Jarvi wrote: > > On Fri, 24 Jun 2005, Vlado Handziski wrote: > > > Hi all, > > > > let me first express my compliments on the great work you have done with > > the RXTX library. > > > > We have been using the library for some time, and we are at a point > where > > we want to make our code public. For legacy reasons, the code that the > > RXTX library is bundled with, uses the javax.comm namespace. We have > been > > using the ChangePackage script to change the RXTX2.1 package from gnu.io > > into javax.comm. We need the independent implementation since we want to > > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > > versions are just not as stable. > > > > On the download page, there is a comment that this is in violation of > > sun's license. Can someone shed more light on this. I was not aware that > > you can protect the names of the java packages. > > > > Best regards, > > Vlado > > > > I can't provide legal advice as I am not a lawyer. > > (v) may not create, or authorize your licensees to create additional > classes, interfaces, or subpackages that are contained in the "java", > "javax" or "sun" packages or similar as specified by Sun in any class file > naming convention; and > > The license is in the commapi package from Sun. The above is also in all > the EULA's you click through to download from Sun if I'm not mistaken. > > Simply put, the license taints developers that agree to it. For those > developers, Sun has control of the javax.comm namespace. > > It really does not make sense to put rxtx 2.1 in the javax.comm namespace. > It will only cause confusion which I think is the point of the clause > above. The gnu.io namespace was perhaps a poor choice and > just tossed in > when reviewing the license to get out of Sun's namespace. > > There is nothing in the rxtx license limiting your freedom in this fashion > though. Many companies are moving to gnu.io and some > distribute it with > popular applications you would recognize. I'm tempted to ask you not > to contaminate rxtx 2.1 with the javax.comm namespace. > > You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm > using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) > extensions to existing classes (which I dont think you are using); it is > not just javax.comm. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050625/1dadc50e/attachment-0400.html From taj at www.linux.org.uk Sun Jun 26 11:34:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 26 Jun 2005 18:34:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. Message-ID: The attached file should fix baud_base and divisor extensions for Linux The patch is against rxtx 2.1 CVS HEAD. To use this patch, you should set the baud rate to 38400. You can then try SerialPort.setBaudBase(int) and SerialPort.setDivisor(int) There are matching int SerialPort.getBaudBase() and int SerialPort.getDivisor(). What baud bases are available depends upon the serial port card and its driver so this is a bit of a blind attempt on my part. I've looked at the w32 API and I dont see anything available yet. The w32 code in RXTX will probably be figuring out the baud rate based on the tried baud base and divisor and just slamming it at the API for now (the API does something with that but I've not found real documentation on what it does). I dont want to try tinkering with the UART directly yet as that would involve poking machine memory directly and could very easily be error prone in bad ways. I don't expect Solaris or any SysV UNIX systems to work at all with this - ever. It is not standard in any way and will throw Exceptions on everything but Linux (w32 will just fail miserably as it is 1/2 implemented). If anyone has looked at custom baud rates before and has some thoughts or just wants to try the attached untested patch, I'd appreciate any feedback. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- ? autom4te.cache ? build ? output cvs server: Diffing . Index: configure =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure,v retrieving revision 1.35.2.59 diff -u -r1.35.2.59 configure --- configure 16 Oct 2004 16:20:34 -0000 1.35.2.59 +++ configure 26 Jun 2005 16:59:28 -0000 @@ -9644,6 +9644,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { #if defined (__GLIBC__) @@ -9782,6 +9784,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { @@ -9825,7 +9829,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -9837,7 +9841,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 26 Jun 2005 16:59:28 -0000 @@ -218,6 +218,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { #if defined (__GLIBC__) @@ -356,6 +358,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { @@ -399,7 +403,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -411,7 +415,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" cvs server: Diffing CNI cvs server: Diffing MACOSX_IDE cvs server: Diffing MACOSX_IDE/CW cvs server: Diffing MACOSX_IDE/ForPackageMaker cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions cvs server: Diffing MACOSX_IDE/ForPackageMaker/Resources cvs server: Diffing MACOSX_IDE/PB cvs server: Diffing WinCE cvs server: Diffing contrib cvs server: Diffing debian cvs server: Diffing src Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 26 Jun 2005 16:59:29 -0000 @@ -2079,15 +2079,17 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int BaudBase The clock frequency divided by 16. Default * BaudBase is 115200. * @return boolean true on success - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:setBaudBase()"); @@ -2097,10 +2099,11 @@ /** * Extension to CommAPI * @return int BaudBase - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getBaudBase() throws UnsupportedCommOperationException + public int getBaudBase() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getBaudBase()"); @@ -2108,13 +2111,14 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, IOException { if ( debug ) z.reportln( "RXTXPort:setDivisor()"); @@ -2124,10 +2128,11 @@ /** * Extension to CommAPI * @returns int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getDivisor() throws UnsupportedCommOperationException + public int getDivisor() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getDivisor()"); Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 26 Jun 2005 16:59:30 -0000 @@ -1877,16 +1877,27 @@ int fd = get_java_var( env, jobj,"fd","I" ); struct serial_struct sstruct; + if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) + { + goto fail; + } + + sstruct.baud_base = (int) BaudBase; + if ( sstruct.baud_base < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetBaudBase", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetBaudBase", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1914,9 +1925,13 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) ( sstruct.baud_base ) ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetBaudBase", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetBaudBase", strerror( errno ) ); @@ -1950,19 +1965,23 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } if ( sstruct.custom_divisor < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetDivisor", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetDivisor", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1971,7 +1990,7 @@ accept: none perform: Find the Divisor used for custom speeds - return: Divisor + return: Divisor negative value on error. exceptions: Unsupported Comm Operation on systems not supporting TIOCGSERIAL comments: @@ -1990,10 +2009,14 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) sstruct.custom_divisor ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetDivisor", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetDivisor", strerror( errno ) ); @@ -2032,7 +2055,7 @@ /* Open and lock the port so nothing else changes the setting */ - if ( LOCK( filename, pid ) ) goto fail;; + if ( LOCK( filename, pid ) ) goto fail; fd = find_preopened_ports( filename ); if( !fd ) Index: src/SerialPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/Attic/SerialPort.java,v retrieving revision 1.3.2.9 diff -u -r1.3.2.9 SerialPort.java --- src/SerialPort.java 12 Oct 2004 08:59:28 -0000 1.3.2.9 +++ src/SerialPort.java 26 Jun 2005 16:59:30 -0000 @@ -103,13 +103,17 @@ public abstract String getUARTType() throws UnsupportedCommOperationException; public abstract boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getBaudBase() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getDivisor() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setLowLatency() throws UnsupportedCommOperationException; public abstract boolean getLowLatency() cvs server: Diffing src/lfd cvs server: Diffing src/psmisc From uwe at kubosch.no Mon Jun 27 14:13:57 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Mon, 27 Jun 2005 22:13:57 +0200 Subject: [Rxtx] RXTX on FC4 Message-ID: <1119903238.2989.27.camel@BPC0276> Hi all! I just got RXTX to work on Fedora Core 4. The standard download did not work. I had to check the code out from CVS and build it, but then it worked flawlessly. Thanks for your good work. Now I wonder if I should contribute the compiled files so that others will have an easier time than me getting RXTX to work on FC4. What do I do? Who do I talk to? donV From taj at www.linux.org.uk Mon Jun 27 14:29:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 27 Jun 2005 21:29:46 +0100 (BST) Subject: [Rxtx] RXTX on FC4 In-Reply-To: <1119903238.2989.27.camel@BPC0276> References: <1119903238.2989.27.camel@BPC0276> Message-ID: On Mon, 27 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I just got RXTX to work on Fedora Core 4. > > The standard download did not work. > > I had to check the code out from CVS and build it, but then it worked > flawlessly. > > Thanks for your good work. > > Now I wonder if I should contribute the compiled files so that others > will have an easier time than me getting RXTX to work on FC4. What do I > do? Who do I talk to? > > The best thing to do with FC is to contibute an extras RPM. Debian does something like this with their .deb packaging. As rxtx is OS neutral, it is almost impossible to have everything on rxtx.org. If you do get a package in Fedora Extras, I can point a link there. The extra's mail list is here: https://www.redhat.com/mailman/listinfo/fedora-extras-list If it would help to have me release a 'stable' .tar.gz of the source for the RPM submittal process I can do that. It would also trigger upgrades in debian which would not be bad. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Mon Jun 27 16:23:20 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 27 Jun 2005 17:23:20 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: Message-ID: <42C07C58.1030608@atcorp.com> Hey Trent, I installed it and now I get IOExceptions instead of the other one. I'm not sure how those changes would have enabled setDivisor and setBaudBase to work though. Is it significant that this is a USB device emulating a serial port? ~ Shawn From taj at www.linux.org.uk Mon Jun 27 18:07:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 01:07:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: <42C07C58.1030608@atcorp.com> References: <42C07C58.1030608@atcorp.com> Message-ID: On Mon, 27 Jun 2005, Shawn Lavelle wrote: > Hey Trent, > I installed it and now I get IOExceptions instead of the other one. > I'm not sure how those changes would have enabled setDivisor and > setBaudBase to work though. Is it significant that this is a USB device > emulating a serial port? > The USB driver probably does not support this. With USB, the ioctl()'s appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through the linux drivers/usb tree and found to ioctl to support this in Linux 2.6.10. RXTX is not doing very much magic, the patch really only gets the serial struct instead of writing a structure with random values for baudbase and handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel level driver issue not a user space library issue. So if you wanted this to work, the usb serial driver would have to handle the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression after looking through the USB tree quickly. I hope that helps. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Jun 27 18:25:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 27 Jun 2005 20:25:22 -0400 Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) Message-ID: Hi All, I wrote: Jasmine: Is this working any better? And Jasmine says: Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) I am using -source 1.3 and -target 1.3 for the compilation, however, we still seem to have this problem, which my machine (for some reason) does not have. Does anyone have any ideas about what might be the problem? Thanks! - DL From taj at www.linux.org.uk Mon Jun 27 19:04:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 02:04:37 +0100 (BST) Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) In-Reply-To: References: Message-ID: On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I wrote: > Jasmine: Is this working any better? > > And Jasmine says: > Nope. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > > I am using -source 1.3 and -target 1.3 > for the compilation, however, we still seem to have this problem, > which my machine (for some reason) does not have. > Does anyone have any ideas about what might be the problem? > This has shown up in the past with jdk 1.5 compiled jars running on jre 1.4 machines. My guess is either jasmine has an old copy of rxtx with the problem on her machine that is being picked up on the classpath or you have not tried this with jre 1.4. The suggested -source/target fix should avoid the problem. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Mon Jun 27 21:23:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 04:23:55 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: On Tue, 28 Jun 2005, Trent Jarvi wrote: > On Mon, 27 Jun 2005, Shawn Lavelle wrote: > > > Hey Trent, > > I installed it and now I get IOExceptions instead of the other one. > > I'm not sure how those changes would have enabled setDivisor and > > setBaudBase to work though. Is it significant that this is a USB device > > emulating a serial port? > > > > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > > RXTX is not doing very much magic, the patch really only gets the serial > struct instead of writing a structure with random values for baudbase and > handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel > level driver issue not a user space library issue. > > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. > > I hope that helps. > > > It may be possible that you can just modify translate_speed and get_java_baudrate in SerialImp.c to have the new high speds you are after. The defines are in /usr/include/termios.h. #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 You can see many of these are not handled. I dont think CommAPI handled more than 57600 or so. int get_java_baudrate( int native_speed ) { switch( native_speed ) { case B0: return 0; case B50: return 50; case B75: return 75; case B110: return 110; case B134: return 134; case B150: return 150; case B200: return 200; case B300: return 300; case B600: return 600; case B1200: return 1200; case B1800: return 1800; case B2400: return 2400; case B4800: return 4800; case B9600: return 9600; case B19200: return 19200; case B38400: return 38400; case B57600: return 57600; default: return -1; } } int translate_speed( JNIEnv *env, jint speed ) { LEAVE( "RXTXPort:translate_speed" ); switch( speed ) { case 0: return B0; case 50: return B50; case 75: return B75; case 110: return B110; case 134: return B134; case 150: return B150; case 200: return B200; case 300: return B300; case 600: return B600; case 1200: return B1200; case 1800: return B1800; case 2400: return B2400; case 4800: return B4800; case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; #ifdef B57600 case 57600: return B57600; #endif /* B57600 */ #ifdef B115200 case 115200: return B115200; #endif /* B115200 */ #ifdef B230400 case 230400: return B230400; #endif /* B230400 */ #ifdef B460800 case 460800: return B460800; #endif /* B460800 */ #ifdef B14400 case 14400: return B14400; #endif /* B14400 */ #ifdef B28800 case 28800: return B28800; #endif /* B28800 */ #ifdef B128000 /* dima */ case 128000: return B128000; #endif /* dima */ #ifdef B256000 /* dima */ case 256000: return B256000; #endif /* dima */ } /* Handle custom speeds */ if( speed >= 0 ) return speed; else { LEAVE( "RXTXPort:translate_speed: Error condition" ); return -1; } } -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 28 05:20:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 28 Jun 2005 07:20:21 -0400 Subject: [Rxtx] cross-compilation using Make for Mac Message-ID: Hi All, Please excuse the long post; Trent said: >" >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. " Here is what I have on the mac version: java -version java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) When I run: http://show.docjava.com:8086/book/cgij/code/jnlp/math.benchmarks.Dhry.jnlp I get: -- listing properties -- jnlpx.heapsize=NULL,NULL jnlpx.splashport=-1 java.runtime.name=Java(TM) 2 Runtime Environment, Stand... java.protocol.handler.pkgs=com.sun.javaws.net.protocol sun.boot.library.path=/System/Library/Frameworks/JavaVM.fra... java.vm.version=1.4.2-38 awt.nativeDoubleBuffering=true gopherProxySet=false http.auth.serializeRequests=true java.vm.vendor="Apple Computer, Inc." java.vendor.url=http://apple.com/ path.separator=: java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io jnlpx.home=/Applications/Utilities/Java/Java Web... user.country=US sun.os.patch.level=unknown java.vm.specification.name=Java Virtual Machine Specification user.dir=/ java.runtime.version=1.4.2_05-141.4 java.awt.graphicsenv=apple.awt.CGraphicsEnvironment java.endorsed.dirs=/System/Library/Frameworks/JavaVM.fra... os.arch=ppc java.io.tmpdir=/tmp line.separator= java.vm.specification.vendor=Sun Microsystems Inc. jnlpx.remove=false os.name=Mac OS X sun.java2d.fontpath= java.library.path=/Applications/Utilities/Java/Java Web... java.specification.name=Java Platform API Specification java.class.version=48.0 jnlpx.deployment.user.home=/Users/lyon/Library/Caches/Java Web S... java.util.prefs.PreferencesFactory=java.util.prefs.MacOSXPreferencesFactory os.version=10.3.9 user.home=/Users/lyon user.timezone=America/New_York java.security.policy=file:/Applications/Utilities/Java/Jav... java.awt.printerjob=apple.awt.CPrinterJob trustProxy=true java.specification.version=1.4 file.encoding=MacRoman jnlpx.deployment.system.home=/Applications/Utilities/Java/J2SE 5.0... user.name=lyon java.class.path=/Applications/Utilities/Java/Java Web... java.vm.specification.version=1.0 sun.arch.data.model=32 java.home=/System/Library/Frameworks/JavaVM.fra... java.specification.vendor=Sun Microsystems Inc. user.language=en awt.toolkit=apple.awt.CToolkit java.vm.info=mixed mode java.version=1.4.2_05 java.ext.dirs=/Users/lyon/Library/Java/Extensions:/... sun.boot.class.path=/System/Library/Frameworks/JavaVM.fra... java.vendor=Apple Computer, Inc. file.separator=/ java.vendor.url.bug=http://developer.apple.com/java/ sun.cpu.endian=big sun.io.unicode.encoding=UnicodeBig mrj.version=141.3 jnlpx.jvm=/System/Library/Frameworks/JavaVM.fra... sun.cpu.isalist= sun.awt.exception.handler=apple.awt.CToolkit$EventQueueExceptio... javawebstart.version=javaws-1.4.2_05 800 mhz g4,878k ds/sec total time: 1184ms Result: 844594 dhrystone/sec. Load average for last 15 minutes:0.62 So, I feel pretty sure that I have tried this with 1.4. As to modifying the RXTX compilation, that I did not do...and I take your point. I have been using the binary distributions as is. Oops. I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Now when I do a make, I get: make gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known libtool: link: warning: undefined symbols not allowed in i386-pc-mingw32 shared libraries rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ln: `SerialImp.o': File exists make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 So, I do a make clean, then a make: .... (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ar cru .libs/librxtxSerial.a /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o ar: /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o: No such file or directory make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 In the i386 directory, there is a symbolic link left from something: ls -al SerialImp.o lrwxrwxrwx 1 lyon lyon 12 Jun 28 07:03 SerialImp.o -> SerialImp.lo However, the SerialImp.lo is not present (which is the cause of the error, I think). On the other hand, the file I am looking for is present in: i686-pc-linux-gnu Possibly the i386 generation is not clean (of course it is also likely that I am just asking dumb questions, being a newbie to the code and all.). Finally, will this make file regenerate the distro for the mac? I found some really old (from year 2001) files in: cvs/MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions Which I could use for the distro...but I would prefer to do a clean, multi-platform build from make. Thanks! - Doug >On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > >> Hi All, >> I wrote: >> Jasmine: Is this working any better? >> >> And Jasmine says: >> Nope. >> >> An error occurred while launching/running the application. >> >> Title: addbk.JAddressBook.Main >> Vendor: DocJava, Inc. >> Category: Unexpected Error >> >> gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) >> >> > > I am using -source 1.3 and -target 1.3 >> for the compilation, however, we still seem to have this problem, >> which my machine (for some reason) does not have. >> Does anyone have any ideas about what might be the problem? >> > >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. > > >The suggested -source/target fix should avoid the problem. > >-- >Trent Jarvi >tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 28 09:43:41 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 28 Jun 2005 10:43:41 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: <42C1702D.1070307@atcorp.com> > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. There is ioctl stuff in the driver for the chip, but i haven't seen the TIOC*SERIAL entries. That might be why it continues to fail. I did get around the problem, though, by hacking the driver and just specifying the baud rate I need. Now everything works well. Thanks for all the assistance you've provided. ~ Shawn M. Lavelle From taj at www.linux.org.uk Tue Jun 28 12:42:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:42:29 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known Add a compiler flag -DWIN32 The code above should not be compiling on w32 as it is #if !defined(WIN32) You can look at the bottom of Makefile.in to see the w32 compile flags. Search for "WIN32 CrossCompiling from here down" If its still not working, I can set you up with the Bob account. Just email me off the list. W32 compiling is a bit complicated. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 28 12:52:50 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:52:50 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Nods. I did change configure but right now it is only in the baudbase/divisor patch I posted. I'm going to add several extension baud rates that can be supported by normal API calls and commit that today as a followup to my comments yesterday on baudrates. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Wed Jun 29 01:52:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 08:52:10 +0100 (BST) Subject: [Rxtx] [PATCH] More baud rate fixes Message-ID: I went through the native baudrate conversion from Java and added several. This patch is against CVS 2.1 head. I think thats it for baud rate fixes unless someone see something. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- A non-text attachment was scrubbed... Name: baud_base_and_divisor_plus_odd_baudrates.diff.gz Type: application/x-gzip Size: 3291 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050629/4c1ef1c2/baud_base_and_divisor_plus_odd_baudrates.diff-0400.gz From lyon at docjava.com Wed Jun 29 10:33:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 29 Jun 2005 12:33:45 -0400 Subject: [Rxtx] java.comm dependencies Message-ID: Hi All, During a build of the rxtx code, I have left the javax.comm out of the system (on purpose). However, I get an error, at run time: CommPortIdentifier:static initialization() apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: javax/comm/CommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver I am thinking that there is something in the gnu.io.CommPortIdentifier that seeks to load the javax.comm.CommDriver. It was my understanding that we could write code without reference to the javax.comm.CommDriver and that we could work in the gnu namespace. Is this true? Thanks! - Doug From taj at www.linux.org.uk Wed Jun 29 11:16:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 18:16:08 +0100 (BST) Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > During a build of the rxtx code, I have left the > javax.comm out of the system (on purpose). > However, I get an error, at run time: > > CommPortIdentifier:static initialization() > apple.awt.EventQueueExceptionHandler Caught Throwable : > java.lang.NoClassDefFoundError: javax/comm/CommDriver > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > that seeks to load the javax.comm.CommDriver. > > It was my understanding that we could write code without reference > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > Is this true? > Yes. People use 2.1 without javax all the time. There should be no reference to javax at all in rxtx 2.1. You may check your code. I just did a grep through 2.1 and there is nothing. You may look at the classes you are using. If you find javax.comm in your code, replace it with gnu.io and that should be all you need to do. -- Trent Jarvi tjarvi at qbang.org From jayant28k at gmail.com Wed Jun 29 21:49:28 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Thu, 30 Jun 2005 09:19:28 +0530 Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: <6a6a02310506292049778c452f@mail.gmail.com> Trent, I think best idea is to have wiki for rxtx code. So as the traffic is increasing with time. "RXTX" seems to be more popular in embbeded system. Sun Microsystems will always apperciate your efforts on parallel and serial ports commincation based application in IT Industry. Thanks for your help on this forum as "ONE MAN ARMY" ;-) Cheers, Jayant On 6/29/05, Trent Jarvi wrote: > On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > > > Hi All, > > During a build of the rxtx code, I have left the > > javax.comm out of the system (on purpose). > > However, I get an error, at run time: > > > > CommPortIdentifier:static initialization() > > apple.awt.EventQueueExceptionHandler Caught Throwable : > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > > that seeks to load the javax.comm.CommDriver. > > > > It was my understanding that we could write code without reference > > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > > > Is this true? > > > > Yes. People use 2.1 without javax all the time. > > There should be no reference to javax at all in rxtx 2.1. You may check > your code. I just did a grep through 2.1 and there is nothing. You may > look at the classes you are using. > > If you find javax.comm in your code, replace it with gnu.io and that > should be all you need to do. > > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From uwe at kubosch.no Sat Jun 25 02:50:24 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Sat, 25 Jun 2005 10:50:24 +0200 Subject: [Rxtx] RXTX in FC3/FC4 Message-ID: <1119689424.12606.14.camel@BPC0276> Hi all! I am trying to get RXTX to work on Fedora Core, version 3 or 4. I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext directory. I have edited the jre/lib/javax.comm.properties according to the docs. I have tried this with both rxtx 2.0 and 2.1. I have tried on two different machines. I have tried with java 1.4.2 and java 1.5.0, both from Sun. I always get a signall 11 from the native libraries when they are loaded. Is this a common problem? Any help is greatly appreciated. Below is the start of the error message. More can be supplied on demand. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x65015A Function=(null)+0x65015A Library=/lib/ld-linux.so.2 NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) - locked <0xed46f628> (a java.util.Vector) - locked <0xed471708> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xed46ebc0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.InitializeDriver(CommPortIdentifier.java:213) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:248) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:351) at com.jpeterson.x10.module.CM11A.allocate(CM11A.java:1160) at net.sourceforge.cruisecontrol.publishers.X10Publisher.send(X10Publisher.java:182) at net.sourceforge.cruisecontrol.publishers.X10Publisher.turnOff(X10Publisher.java:171) at net.sourceforge.cruisecontrol.publishers.X10Publisher.handleBuild(X10Publisher.java:148) at net.sourceforge.cruisecontrol.publishers.X10Publisher.publish(X10Publisher.java:141) at net.sourceforge.cruisecontrol.Project.publish(Project.java:679) at net.sourceforge.cruisecontrol.Project.build(Project.java:227) at net.sourceforge.cruisecontrol.Project.execute(Project.java:153) at net.sourceforge.cruisecontrol.ProjectWrapper.run(ProjectWrapper.java:66) at java.lang.Thread.run(Thread.java:534) From chris_jh at blueyonder.co.uk Tue Jun 28 05:37:10 2005 From: chris_jh at blueyonder.co.uk (Christopher Harris) Date: Tue, 28 Jun 2005 12:37:10 +0100 Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError Message-ID: <42C13666.9030108@blueyonder.co.uk> Hi I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 32bit) The serial ports work fine with no issues, but when i try to use the parallel port i get this message Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:66) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) I am trying to print a line out to port "/dev/lp0" At first i thought it could not find the librxtxParallel.so file, but when i renamed it i got a different saying it could not find the library. I have tried to run as root no difference. It is really weird, i get no compile errors and the serial ports work fine. I changed the LPRPort.java and commented out the Initialize call method. And just get the same error but for the method open. It is as though it can't see the methods, and yet it can see the library. I did have a bit of check of the JNI implementation in rxtx but could not spot anything. Yours Thankfully Christopher Harris From lyon at docjava.com Thu Jun 30 02:28:09 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 04:28:09 -0400 Subject: [Rxtx] tools Message-ID: Hi All, I have been thinking about automatic cross-platform native method development of Java/C programs. It appears that different binary tools are needed to target different platforms. Configuration seems a bit painful. Is there something better available than make? Is ANT any good at this? Has anyone tried: http://jnipp.sourceforge.net/ Thanks! - Doug From lyon at docjava.com Thu Jun 30 04:11:17 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 06:11:17 -0400 Subject: [Rxtx] javax.comm Message-ID: Hi All, When I load my jar files on a linux box, all is well. However, when I load them on a mac, I get: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver The jar files for the mac are different from the jar files for linux, because recompilation of the native code for the mac has not been easy, for me. As a result, the RXTX jars are tending toward specific versions and platforms. Probably, this is not an ideal situation, but, I suspect, it is common. I have an idea that we could create a single JNLP distro site that we can make reference to that would enable a uniform repository of synchronized signed native methods and jars for RXTX. For example, the one-wire Maxim folks have a real-nice approach where their stuff makes reference to another JNLP file that contains all the stuff we need to make RXTX work. Check it out at: http://www.maxim-ic.com/products/ibutton/software/1wire/OneWireViewer.cfm However, even they have problems on an unconfigured machine: Specified adapter name "DS9097U" is not known * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cannot load default adapter. Please check that the adapter is connected and that no other application is using the port. If you have checked the adapter, the default port might not be selected. Either set the value of the TMEX default using the utility provided with the TMEX Runtime, or create a new file in the /lib folder called onewireviewer.properties with two lines, similar to the following: #native win32 drivers adapter.name={DS9097U} adapter.port=COM1 #or javax.comm drivers adapter.name=DS9097U adapter.port=COM1 The full path to this file should be: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/onewireviewer.properties ---- Wow, that is a show stopper! Configuration is something that we really need to think about as an automatic thing, particularly for web start users. You can't ask a person who wants to run an application to figure out how to alter a properties file. If you know you need one, then get permission and make one...automatically. That makes a lot of sense, to me. Basically, we need an installer. At the very least, all the pre-built binaries and jars needed for the RXTX package on several platforms should be available from a single place. One this happens, we can make a JNLP file that is platform specific, but can give us a level of indirection. Is this something that has been done already? Thanks! - Doug From taj at www.linux.org.uk Thu Jun 30 08:10:22 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 15:10:22 +0100 (BST) Subject: [Rxtx] tools In-Reply-To: References: Message-ID: On Thu, 30 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I have been thinking about automatic cross-platform > native method development of Java/C programs. > > It appears that different binary tools are needed to target different > platforms. Configuration seems a bit painful. > > Is there something better available than make? > > Is ANT any good at this? I'm far from an Ant expert but have used it for other projects. The main problem I see with ant is there is no mainstream support for platform neutral neutral library creation as far as I can tell. I think ant is a fine replacement for make but I've not seen a suitable replacement for autoconf. At that point, make is as good as anything. It should be possible to create a ant build.xml that works on say Solaris, Linux, Windows and Mac OS X. The problem is when you are trying to build a library for embeded ARM from Mac OS X. > Has anyone tried: > http://jnipp.sourceforge.net/ -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:22:02 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:22:02 +0100 (BST) Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <1119689424.12606.14.camel@BPC0276> References: <1119689424.12606.14.camel@BPC0276> Message-ID: On Sat, 25 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I am trying to get RXTX to work on Fedora Core, version 3 or 4. > > I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 > directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext > directory. > > I have edited the jre/lib/javax.comm.properties according to the docs. > > I have tried this with both rxtx 2.0 and 2.1. > > I have tried on two different machines. > > I have tried with java 1.4.2 and java 1.5.0, both from Sun. > > I always get a signall 11 from the native libraries when they are > loaded. Is this a common problem? Any help is greatly appreciated. > Below is the start of the error message. More can be supplied on > demand. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x65015A > Function=(null)+0x65015A > Library=/lib/ld-linux.so.2 > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) If you compile rxtx from source, this will probably go away. I'm not sure what the exact cause is but it looks like the binaries are not suitable for FC3/4. The ABI may have changed since those had been compiled. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:26:56 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:26:56 +0100 (BST) Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError In-Reply-To: <42C13666.9030108@blueyonder.co.uk> References: <42C13666.9030108@blueyonder.co.uk> Message-ID: tOn Tue, 28 Jun 2005, Christopher Harris wrote: > Hi > > I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 > 32bit) > > The serial ports work fine with no issues, but when i try to use the > parallel port i get this message > > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:66) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) > > > I am trying to print a line out to port "/dev/lp0" > > At first i thought it could not find the librxtxParallel.so file, but > when i renamed it i got a different saying it could not find the library. > > I have tried to run as root no difference. > > It is really weird, i get no compile errors and the serial ports work fine. > > I changed the LPRPort.java and commented out the Initialize call method. > And just get the same error but for the method open. > > It is as though it can't see the methods, and yet it can see the library. > I did have a bit of check of the JNI implementation in rxtx but could > not spot anything. > > > You can check if the symbols are in the shared library: nm librxtxSerial.so |grep Initialize If the symbols are not there, there was a build error. Watch very close for build errors while compiling from source. I suspect something isnt behaving right. -- Trent Jarvi tjarvi at qbang.org From allen at adbyrne.us Thu Jun 30 06:55:58 2005 From: allen at adbyrne.us (Allen Byrne) Date: Thu, 30 Jun 2005 07:55:58 -0500 Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> References: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> Message-ID: <200506300755.59159.allen@adbyrne.us> On Thursday 30 June 2005 00:31, rxtx-request at mail.electronpusher.org wrote: > >Message: 8 >Date: Sat, 25 Jun 2005 10:50:24 +0200 >From: Uwe Kubosch >Subject: [Rxtx] RXTX in FC3/FC4 >To: rxtx at mail.electronpusher.org >Message-ID: <1119689424.12606.14.camel at BPC0276> >Content-Type: text/plain > >Hi all! > >I am trying to get RXTX to work on Fedora Core, version 3 or 4. > >I have tried this with both rxtx 2.0 and 2.1. > >I have tried on two different machines. > >I have tried with java 1.4.2 and java 1.5.0, both from Sun. > >I always get a signall 11 from the native libraries when they are >loaded. ?Is this a common problem? ?Any help is greatly appreciated. >Below is the start of the error message. ?More can be supplied on >demand. > >An unexpected exception has been detected in native code outside the VM. >Unexpected Signal : 11 occurred at PC=0x65015A >Function=(null)+0x65015A >Library=/lib/ld-linux.so.2 > I had thi same problem on SUSE9.3 and java 1.5.0. After searching through the archives, I found a patch that required adding a sleep(1000) command in two functions of SerialIO.java. This only was for rxtx2.1, I had no trouble with rxtx2.0. Note, also I had to add the "|1.5*" sequence to the configure.in file to get good *.so libs. Again 2.0 was fine. -- Allen Byrne adbyrne at ieee.org http://modelrr.adbyrne.us From taj at www.linux.org.uk Fri Jun 3 01:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 08:57:29 +0100 (BST) Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 3 09:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 16:57:53 +0100 (BST) Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi at qbang.org From jasmine at electronpusher.org Fri Jun 3 10:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 17:12:21 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 11:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:02:09 +0100 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 11:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:05:10 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From jon.nall at gmail.com Mon Jun 6 09:13:58 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 10:13:58 -0500 Subject: [Rxtx] StackOverflowError Message-ID: I have a fairly small application that is communicating to a microcontroller programmer at 115.2k. I have a test where I try and dump the memory of the microcontroller (whose size is 8k and change). Things are going smoothly and the data looks good. Then after reading out ~6.5k of data, I get a StackOverflowError. The stack trace looks like: CommInterface.serialEvent(): 324 // this is my code RXTXPort.sendEvent(): 732 RXTXPort.eventLoop() [Native] MonitorThread.run(): 1531 I am running on windows and using rxtx-2.1-CVS-20050120. When I increased the stack size to 512k, I could read the entire chip without issue. But that doesn't seem like the right thing to do without root causing what's happening. My code doesn't include any recursion and the stack trace looks terribly short, so I'm a bit confused as to why I'm getting a StackOverflowError. CommInterface.serialEvent() does little more than grab the available bytes, enter a synchronized block, stick them in a common data area for the main thread to use and leave the synchronization block. I guess my question is: are there any known issues with the default stack size when using the latest rxtx on windows? thanks, nall. From taj at www.linux.org.uk Mon Jun 6 09:27:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 16:27:34 +0100 (BST) Subject: [Rxtx] StackOverflowError In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > I have a fairly small application that is communicating to a > microcontroller programmer at 115.2k. I have a test where I try and > dump the memory of the microcontroller (whose size is 8k and change). > Things are going smoothly and the data looks good. Then after reading > out ~6.5k of data, I get a StackOverflowError. The stack trace looks > like: > > CommInterface.serialEvent(): 324 // this is my code > RXTXPort.sendEvent(): 732 > RXTXPort.eventLoop() [Native] > MonitorThread.run(): 1531 > > I am running on windows and using rxtx-2.1-CVS-20050120. When I > increased the stack size to 512k, I could read the entire chip without > issue. But that doesn't seem like the right thing to do without root > causing what's happening. My code doesn't include any recursion and > the stack trace looks terribly short, so I'm a bit confused as to why > I'm getting a StackOverflowError. > > CommInterface.serialEvent() does little more than grab the available > bytes, enter a synchronized block, stick them in a common data area > for the main thread to use and leave the synchronization block. > > I guess my question is: are there any known issues with the default > stack size when using the latest rxtx on windows? > This is the first I've heard of the problem. It is strange as you mention lookin at the stack trace. That cant be taking up too much space. If you just toss the data instead of trying to put it in your work area, does it persist? -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Mon Jun 6 10:09:39 2005 From: lengyel at gmail.com (FL) Date: Mon, 6 Jun 2005 12:09:39 -0400 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on which the jdk1.5.0_03 is installed. I found that the INSTALL documentation seems to be in error. It states that javacomm20-x86.tar.Z (the Java Communications API for Solaris/x86) must be used, in fact this choice led to the following test with theBlackBox sample program in the commapi: root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG BlackBox -p /dev/ttyS0 Port /dev/ttyS0 not found! No serial ports found! Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to cause Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to the Eclipse stable build version 3.1M7 to avoid this. However, I found that using the Solaris/Sparc version of commapi worked on my system. I have documented this on: http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050606/b28fb9a7/attachment-0401.html From taj at www.linux.org.uk Mon Jun 6 10:30:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:30:27 +0100 (BST) Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, FL wrote: > I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on > which the jdk1.5.0_03 is installed. I found that the INSTALL documentation > seems to be in error. It states that javacomm20-x86.tar.Z (the Java > Communications API for Solaris/x86) must be used, in fact this choice led to > the following test with theBlackBox sample program in the commapi: > > root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG > BlackBox -p /dev/ttyS0 > Port /dev/ttyS0 not found! > No serial ports found! > > Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to > cause > Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to > the Eclipse stable build version 3.1M7 to avoid this. > > However, I found that using the Solaris/Sparc version of commapi > worked on my system. > > I have documented this on: > > http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 > Thanks FL. I'll change the documentation to point to the SPARC comm.jar. In the past, any Solaris was good enough, we tried to avoid the w32 comm.jar because it made native calls rxtx would never implement on any OS as they are not platform neutral. I'll withold comments about Sun's comm.jar being different on various CPUs within even the same OS. RXTX 2.1 does not need to do that even acrossed OSs for instance. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 6 10:35:43 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 11:35:43 -0500 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API Message-ID: It seems that Sun's javax.comm site does not include JavaDoc'ed API and the RxTx site has the API, but no real documentation. Is there some site that i'm just missing in my google searches? I'm looking for a copy of the javax.comm API which is documented. Thanks, nall. From taj at www.linux.org.uk Mon Jun 6 10:44:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:44:03 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > It seems that Sun's javax.comm site does not include JavaDoc'ed API > and the RxTx site has the API, but no real documentation. Is there > some site that i'm just missing in my google searches? I'm looking for > a copy of the javax.comm API which is documented. > > Thanks, > nall. Sun's version is with their binary downloads. RXTX tries to match that so I never bothered with more complete JavaDocs. Whatever Sun documents is what we try to do. -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Mon Jun 6 12:13:44 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 6 Jun 2005 14:13:44 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: Message-ID: <20050606181245.528C929D56F@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Trent Jarvi > Sent: Monday, June 06, 2005 12:44 PM > To: Jon Nall; Java RXTX discussion > Subject: Re: [Rxtx] Where can I find JavaDoc on the javax.comm API > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > It seems that Sun's javax.comm site does not include JavaDoc'ed API > > and the RxTx site has the API, but no real documentation. Is there > > some site that i'm just missing in my google searches? I'm > looking for > > a copy of the javax.comm API which is documented. > > > > Thanks, > > nall. > > Sun's version is with their binary downloads. RXTX tries to > match that so I never bothered with more complete JavaDocs. > Whatever Sun documents is what we try to do. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Try http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht ml -Ack From gadelavega at yahoo.com.ar Mon Jun 6 12:58:09 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Mon, 6 Jun 2005 15:58:09 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606181245.528C929D56F@mail.electronpusher.org> Message-ID: <20050606185809.57069.qmail@web14603.mail.yahoo.com> --- "David S. Acker" escribi?: > > -----Original Message----- > > From: rxtx-bounces at mail.electronpusher.org > > [mailto:rxtx-bounces at mail.electronpusher.org] On > Behalf Of Trent Jarvi > > Sent: Monday, June 06, 2005 12:44 PM > > To: Jon Nall; Java RXTX discussion > > Subject: Re: [Rxtx] Where can I find JavaDoc on > the javax.comm API > > > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > > > It seems that Sun's javax.comm site does not > include JavaDoc'ed API > > > and the RxTx site has the API, but no real > documentation. Is there > > > some site that i'm just missing in my google > searches? I'm > > looking for > > > a copy of the javax.comm API which is > documented. > > > > > > Thanks, > > > nall. > > > > Sun's version is with their binary downloads. > RXTX tries to > > match that so I never bothered with more complete > JavaDocs. > > Whatever Sun documents is what we try to do. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > Try > http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > ml > -Ack > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > I'm prety sure it was there... but not anymore. Gonzalo A. de la Vega, BI ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From taj at www.linux.org.uk Mon Jun 6 18:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 01:09:14 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606185809.57069.qmail@web14603.mail.yahoo.com> References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: >> http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > > I'm prety sure it was there... but not anymore. > It is there. Maybe the URL got mangled. Try this http://tinyurl.com/8dfp7 It just redirects you to: http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.html -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 7 05:46:39 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Jun 2005 07:46:39 -0400 Subject: [Rxtx] rxtx under fedora - odd procedures Message-ID: Hi All, I was able to get RXTX communications to work under Fedora, but only after I added myself to the UUCP and LOCK groups, logged out and then logged back in. Both groups appear to be needed in order to access the serial ports. Also the group alter did not take until after I logged out and logged back in. My theory is that you need permission to write to the var/spool directory under fedora and that this is the only way to do it. Logging out and logging back in just seems like an odd thing to do. I suppose some users may have to restart X. Ouch! Is this true? The alter_group command indicates that you need to be an su to alter the group database. Does this mean that my serial port users need a database su able person to use serial port applications under RXTX? If so, what is the procedure to make a transparent install work using Java web start? Should I be prompting users for the su password? Should I be telling users to exit from X and log out? Is this the way other serial communications programs work? Thanks! - Doug From sean_montgomery at baseview.com Tue Jun 7 08:14:51 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 7 Jun 2005 10:14:51 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: >>> http://java.sun.com/products/javacomm/javadocs/javax/comm/package- >>> summary.ht >>> > > >> >> I'm prety sure it was there... but not anymore. >> >> > > It is there. Maybe the URL got mangled. Try this > > http://tinyurl.com/8dfp7 > > It just redirects you to: > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > summary.html > Maybe the issue here is that the info is available without frames from that URL, but when you try to access it with frames (from the link on that page) it doesn't work - it takes you to: http://java.sun.com/products/javacomm/javadocs/index.html Which doesn't have anything useful on it. From gadelavega at yahoo.com.ar Tue Jun 7 08:22:50 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:22:50 -0300 (ART) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: Message-ID: <20050607142251.92850.qmail@web14626.mail.yahoo.com> --- "Dr. Douglas Lyon" escribi?: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the > group > alter did not take until after I logged out and > logged back in. > > My theory is that you need permission to write to > the var/spool > directory under fedora and that this is the only way > to do it. > > Logging out and logging back in just seems like an > odd thing to > do. I suppose some users may have to restart X. > Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port > applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log > out? > Is this the way other serial communications programs > work? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Actually, you need the lock group to acces /var/lock directory, and uucp to acces /dev/ttyS*. You (as root) shuold add all users you will allow to use the serial ports to group uucp and all the ones you'll allow to lock the ports to lock group (rxtx needs both). This is not only for rxtx, but for any use of the serial ports. Next time they login they'll be able to work, so if they are in they'll have to log out first. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From gadelavega at yahoo.com.ar Tue Jun 7 08:23:56 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:23:56 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> Message-ID: <20050607142356.93815.qmail@web14624.mail.yahoo.com> --- Sean Montgomery escribi?: > > On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: > > >>> > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > >>> summary.ht > >>> > > > > > >> > >> I'm prety sure it was there... but not anymore. > >> > >> > > > > It is there. Maybe the URL got mangled. Try this > > > > http://tinyurl.com/8dfp7 > > > > It just redirects you to: > > > > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > > summary.html > > > > Maybe the issue here is that the info is available > without frames > from that URL, but when you try to access it with > frames (from the > link on that page) it doesn't work - it takes you > to: > > http://java.sun.com/products/javacomm/javadocs/index.html > > Which doesn't have anything useful on it. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > That's right, my bad. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From jon.nall at gmail.com Tue Jun 7 08:33:40 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 09:33:40 -0500 Subject: [Rxtx] performance expectations Message-ID: Hi all. I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC microcontroller. The protocol I'm using (which I didn't create) looks like this for the section of code I'm concerned with: PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data PIC -> PC: 0x01 // ACK 0xNN // First 8 bits of data 0xMM // Second 8 bits of data I issue ~2000 of these Read commands. The PIC itself has an input fifo which can store 18 bytes, so I can have 18 read commands in flight at a given time. The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k 8N1. I am measuring the time it takes to perform these 2000 commands at around 30 seconds, which is much longer than I anticipated. With the link fully utilized, I expected: Time per byte transmitted: 115200 / 8 = 14400 bytes/second = ~70 uS/byte Time per response transmitted: ~70 uS/byte * 3 bytes/response = ~210 uS/response Time for 2000 responses to be transmitted: ~210 uS/response * 2000 responses = ~420ms I'm a bit new to this, so I may have made some bad asumptions, but I would have expected a time of a couple of seconds to perform the 2000 reads, not 30+ seconds. I'm obviously missing something here. Can someone help me understand what's going on? Thanks, nall. From taj at www.linux.org.uk Tue Jun 7 09:17:48 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:17:48 +0100 (BST) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the group > alter did not take until after I logged out and logged back in. > > My theory is that you need permission to write to the var/spool > directory under fedora and that this is the only way to do it. > > Logging out and logging back in just seems like an odd thing to > do. I suppose some users may have to restart X. Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log out? > Is this the way other serial communications programs work? > RIght now, rxtx requires you do one of two things. 1) Use lock files (recommended). This requires intervention by the root users to allow users to create lock files and open the ports as you note. 2) configure rxtx with --disable-lockfiles. In this case you need only worry about the permissions on /dev/ttyS* I'm not sure what the default on Fedora is with respect to permisions. This is not very attractive. There is a better way it could be done on Fedora. Fedora comes with lockdev library. I've been considering this for some time. We could use that for the locking and do away with many of the problems. The problem is embeded devices running Linux do not come with liblockdev. But for your use, I would consider adding a new option for locking serial devices using liblockdev. lockdev-devel has a man page with further information. SYNOPSIS #include pid_t dev_testlock( const char * devname); pid_t dev_lock( const char * devname); pid_t dev_relock( const char * devname, pid_t pid); pid_t dev_unlock( const char * devname, pid_t pid); cc [ flag ... ] file ... -llockdev [ library ] This would probably need to be a configure time option to prevent problems on embeded Linux devices but could otherwise be the default on Linux. I could toss a quick patch together if this is confusing. It is actually easier than what rxtx does now. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 09:27:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:27:11 +0100 (BST) Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > Hi all. > I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC > microcontroller. The protocol I'm using (which I didn't create) looks like this > for the section of code I'm concerned with: > > PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data > PIC -> PC: 0x01 // ACK > 0xNN // First 8 bits of data > 0xMM // Second 8 bits of data > > I issue ~2000 of these Read commands. The PIC itself has an input fifo which > can store 18 bytes, so I can have 18 read commands in flight at a given time. > The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k > 8N1. > > I am measuring the time it takes to perform these 2000 commands at around 30 > seconds, which is much longer than I anticipated. With the link fully utilized, > I expected: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte > > Time per response transmitted: > ~70 uS/byte * 3 bytes/response = ~210 uS/response > > Time for 2000 responses to be transmitted: > ~210 uS/response * 2000 responses = ~420ms > > I'm a bit new to this, so I may have made some bad asumptions, but I would have > expected a time of a couple of seconds to perform the 2000 reads, not 30+ > seconds. > > I'm obviously missing something here. Can someone help me understand what's > going on? > I've hooked rxtx in loopback with a scope in the past at 9600 baud (baud rate is not important). Using event notification and just writing a byte on event/read the latencey was around 8-12 ms. The JNI is not an efficient way to use native code - especially for bit banging. So if timing is critical you want to move some of the logic into the native code rather than banging over the JNI. 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your performance. C# has advantages here. If you move your logic into the native layer or use gcj (rxtx will work with that too) most of your latency should vanish. You may have to play with some sleeps in eventLoop at that point to get full native efficiency. With gcj all of rxtx becomes 'native code' as java is just treated as a subset of C++. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 09:38:51 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 10:38:51 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: On 6/7/05, Jon Nall wrote: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte of course that should be divided by 10 to account for the start/stop bits, but it barely changes the end results. From carobizar at free.fr Tue Jun 7 10:21:29 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 7 Jun 2005 18:21:29 +0200 Subject: [Rxtx] (no subject) Message-ID: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Hello ! I am a french student and I have to create an application able to read and write on serial and parallel port and to run on Windows and Linux. For the moment my program run on Windows thanks the Java Communication API (version for Microsoft Windows and Solaris/x86). But it doesn't work on Linux. Does a recent version of an installation documentation exist ? I didn't find one on the RXTX site (nothing for the windows installation and the linux installation deals with a "jcl.jar" that I don't know...). So, I have some questions : 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 version or Linux&w32 version ?) What are the differences between them ? Which of them are the most stable ? 2) Where have I to put the .so and .dll files ? 3) What have I to write on the file javax.comm.properties ? 4) Have I to delete the file win32comm.dll included in the Java Comm API ? 5) Have I to keep both comm.jar and RXTXcomm.jar ? Best regards, Caroline. From debief at telemsa.com Tue Jun 7 10:44:56 2005 From: debief at telemsa.com (DEBIEF Eric) Date: Tue, 7 Jun 2005 18:44:56 +0200 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: <200506071844.56656.debief@telemsa.com> Hi, We are "pushing" RxTx /Java here in a half-duplex link. The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC and application handling) about 25?s/byte. The figures are the barely the same on two environments. Environment 1 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Linux 2.6.3, Mdk 10.0. RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : bytes are lost on the wire. I need to investigate this mystery.... Java : 1.4.2-rc1 Blackdown Environment 2 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Windows 2000 Pro RxTx : 2.0.7. Java : 1.4.2_08 SUN I Hope this help, Eric. _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 7 11:05:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:05:45 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, DEBIEF Eric wrote: > Hi, > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. How many write() calls is this? > > Environment 1 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Linux 2.6.3, Mdk 10.0. > RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : > bytes are lost on the wire. I need to investigate this mystery.... > Java : 1.4.2-rc1 Blackdown > > Environment 2 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Windows 2000 Pro > RxTx : 2.0.7. > Java : 1.4.2_08 SUN > In my event/read/write test I found windows was ~20% faster than linux for some reason (strange part is Windows was in VMWare on the same Linux machine). It was about the same rxtx version. There are many problems with rxtx 1.4 with respect to commapi on windows but its code paths are more simple. What some people want from rxtx is perhaps better served by hacking up the very first release as they just want to read and write which is what rxtx was before Sun released commapi. It sounds like perhaps you are pushing out larger writes which will greatly improve results. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 11:16:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:16:49 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118161289.42a5c989cf6a2@imp4-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: On Tue, 7 Jun 2005 carobizar at free.fr wrote: > > Hello ! > > I am a french student and I have to create an application able to read and write > on serial and parallel port and to run on Windows and Linux. > For the moment my program run on Windows thanks the Java Communication API > (version for Microsoft Windows and Solaris/x86). > But it doesn't work on Linux. > > Does a recent version of an installation documentation exist ? > I didn't find one on the RXTX site (nothing for the windows installation and the > linux installation deals with a "jcl.jar" that I don't know...). > > So, I have some questions : > > 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 > version or Linux&w32 version ?) What are the differences between them ? Which > of them are the most stable ? > Use rxtx 2.0 with commapi for sparc solaris from Sun. If you want your current package javax.comm. > 2) Where have I to put the .so and .dll files ? On Linux just use the source, the configure script will do all of that for you. tar -xzvf rxtx-2.0-version mkdir rxtx-2.0-version/build cd rxtx-2.0-version/build ../configure && make install It will do everything for you. With Windows, you need to create the javax.comm.properties and install the DLL on your path. But you can just use Sun's package too. They are intended to be interchangable. > > 3) What have I to write on the file javax.comm.properties ? Driver=gnu.io.RXTXCommDriver More documentation in INSTALL that comes with the source. Sun's documentation should work too. configure does this for you on Linux. > > 4) Have I to delete the file win32comm.dll included in the Java Comm API ? > No > 5) Have I to keep both comm.jar and RXTXcomm.jar ? > Yes. RXTX 2.1 replaces comm.jar but the package is different (gnu.io) to avoid contaminating Sun's namespace. With rxtx 2.0 you need Sun's comm.jar - they work together. > > Best regards, > Caroline. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Tue Jun 7 12:07:34 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 14:07:34 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 Message-ID: <20050607180632.1543A29D5C8@mail.electronpusher.org> Hello, I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our product includes a built in USB to Serial adapter so that when it is connected to your PC over USB, it appears as a serial port. We had problems with Sun's comm library because it did not detect serial ports coming and going properly. I did run into a few issues with RxTx though. I am building under Windows (we support XP and 2000) under cygwin. I used a simple make file for the c code that works under cygwin and ant to build the java stuff. Attached is a diff file. The patches hit the following issues: ParallelImp.c - I am not using config so there is no config.h for me. Also, gcc didn't like a local file (win32termios.h) getting included with <> . RXTXPort.java - You can get an exception during the writeByte, writeArray, nativeDrain, readByte, read, readArray, readTerminatedArray, and nativeAvailable calls. Without this patch the IOLocked count gets stuck incremented. termios.c - If you try to open a port through CreateFile and get ERROR_ACCESS_DENIED it means someone else is using the port. We need to make sure to use serial_close instead of just close. I found that some devices finish their I/O synchronously. The code was treating this as an error. I also added some checking on the ClearError calls. I found a compile error when debugging is turned on (see the usleep change). SerialImp.c - Again, I don't have a config.h and again we must use quotes and not <> to include win32termios.h . I also commented out a report call since it seems to happen constantly on my system. Feel free to use these in any way that you want or just to ignore them. Thanks! -Dave Acker dacker at nomadio.net Software Engineer Nomadio, Inc. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diffs.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/5671d159/diffs-0398.txt From jon.nall at gmail.com Tue Jun 7 12:28:16 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 13:28:16 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, DEBIEF Eric wrote: > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. Hi. This is helpful, thanks. I can think of 2 reasons I'm not collecting the data as fast as I think I should be: 1) the device to PC connection is not at 100% utilization 2) my SerialPortEventListener processing has too much overhead Are there other explanations I might be missing as to why it takes so long to transfer the data? Thanks. nall. From taj at www.linux.org.uk Tue Jun 7 13:21:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:21:46 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > On 6/7/05, DEBIEF Eric wrote: > > We are "pushing" RxTx /Java here in a half-duplex link. > > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > > and application handling) about 25?s/byte. > > The figures are the barely the same on two environments. > > Hi. > This is helpful, thanks. I can think of 2 reasons I'm not collecting > the data as fast as I think I should be: > 1) the device to PC connection is not at 100% utilization > 2) my SerialPortEventListener processing has too much overhead > > Are there other explanations I might be missing as to why it takes so > long to transfer the data? > Polling the port would probably make more sense. You can set the threshold/timeouts to avoid racing and not deal with the event notification. As mentioned earlier I think the event latency is ~10ms. Keep the event listener around, rxtx 2.* does not close well without it. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 13:27:27 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 14:27:27 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, Trent Jarvi wrote: > Polling the port would probably make more sense. You can set the > threshold/timeouts to avoid racing and not deal with the event > notification. As mentioned earlier I think the event latency is ~10ms. Trent, Thanks for the response. Just to make sure I understand what you're talking about, when you say event latency, do you mean the time it takes from when the byte hits the PC's comm port to when rxtx presents it to user code? So if the link is 100% utilized, will my user code see "hiccups" or a steady stream of data? Thanks for helping a serial port newbie. nall. From dacker at nomadio.net Tue Jun 7 13:32:20 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 15:32:20 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <20050607193118.5499329CAA0@mail.electronpusher.org> Some folks asked about the make file and ant steps. I have JAVA_HOME set as follows: $ echo $JAVA_HOME C:\Program Files\Java\jdk1.5.0_01 I have all the code in rxtx/src put into gnu/io . The make file here doesn't have optimizations turned on. We have not tested with it yet. --------------Begin Makefile------------------ CPPFLAGS="-I$(JAVA_HOME)/include" "-I$(JAVA_HOME)/include/win32" SOBJECTS=SerialImp.o fuserImp.o termios.o fixup.o init.o POBJECTS=ParallelImp.o termios.o init.o DLLS=rxtxParallel.dll rxtxSerial.dll all: $(CLASSES) $(DLLS) rxtxSerial.dll: $(SOBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(SOBJECTS) rxtxParallel.dll: $(POBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(POBJECTS) clean: rm -fv $(SOBJECTS) $(POBJECTS) $(DLLS) %.o: %.c gcc -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< %.o: %.cpp g++ -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< --------------End Makefile------------------ Here is the ant target I use to build the rxtx libs. Our build puts the class files in a bin dir. We copy the dlls to a deploy dir and to the build dir. Eclipse seems to like the dlls in the build dir. The deploy dir is used when we build our full package. --------------Begin Ant Section------------------ --------------End Ant Section------------------ > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > David S. Acker > Sent: Tuesday, June 07, 2005 2:08 PM > To: 'Java RXTX discussion' > Subject: [Rxtx] Patches to 2.1-7pre17 > > Hello, > I am using RxTx with the Nomadio Sensor, > http://www.nomadio.net/ . Our product includes a built in > USB to Serial adapter so that when it is connected to your PC > over USB, it appears as a serial port. We had problems with > Sun's comm library because it did not detect serial ports > coming and going properly. > > I did run into a few issues with RxTx though. I am building > under Windows (we support XP and 2000) under cygwin. I used > a simple make file for the c code that works under cygwin and > ant to build the java stuff. Attached is a diff file. The > patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h > for me. Also, gcc didn't like a local file (win32termios.h) > getting included with <> . > > RXTXPort.java - You can get an exception during the > writeByte, writeArray, nativeDrain, readByte, read, > readArray, readTerminatedArray, and nativeAvailable calls. > Without this patch the IOLocked count gets stuck incremented. > > termios.c - If you try to open a port through CreateFile and > get ERROR_ACCESS_DENIED it means someone else is using the > port. We need to make sure to use serial_close instead of > just close. I found that some devices finish their I/O > synchronously. The code was treating this as an error. I > also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we > must use quotes and not <> to include win32termios.h . I > also commented out a report call since it seems to happen > constantly on my system. > > Feel free to use these in any way that you want or just to > ignore them. > Thanks! > > -Dave Acker > dacker at nomadio.net > Software Engineer > Nomadio, Inc. > From taj at www.linux.org.uk Tue Jun 7 13:37:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:37:45 +0100 (BST) Subject: [Rxtx] Re: Stack Smashing Attack In-Reply-To: <200506072012.48860.ferdinand.tatzig@web.de> References: <200506072012.48860.ferdinand.tatzig@web.de> Message-ID: On Tue, 7 Jun 2005, Ferdinand Tatzig wrote: > Dear Trent > > I am using RXTX for serial port communication between a PC and a payment > transaction terminal. > When I run my application under Windows 2000, an i386-Linux or an i386-FreeBSD > it works as I expect it to do. However, when I start it to run on AMD64 > machine with a 64-bit Gentoo Linux, the VM terminates with the following > error: > > Port found: /dev/ttyS0 > java: stack smashing attack in function configure_port() > > I am using a 64-bit Blackdown-1.4.2-01 VM. > > I have searched the internet but have found no information about this error. > > This is the code of the method which initializes the serial port: > > /** > * initializes a serial port for communication with a terminal; only > * accessible within this class > * > * @param communication > * @param serialPortToBeInitialized > * @param tillInterfaceEventListener > */ > private TillInterfaceSerialPort(Communication communication, > String serialPortToBeInitialized, > TillInterfaceEventListener tillInterfaceEventListener) > throws IOException, PortInUseException, > TillInterfaceSerialPortNotFoundException, > TooManyListenersException, UnsupportedCommOperationException { > serialPortName = "not initialized yet"; > CommPortIdentifier portId = null; > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > boolean portFound = false; > String temporarySerialPortName = "not initialized yet"; > > // look for a serial port > while (portList.hasMoreElements() && !portFound) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > temporarySerialPortName = portId.getName(); > if (temporarySerialPortName.equals(serialPortToBeInitialized)) { > System.out.print("Port found: "); > System.out.println(temporarySerialPortName); > serialPortName = temporarySerialPortName; > portFound = true; > } > } > } > if (portFound) { > > // initialize the found port - this command causes the VM to terminate > serialPort = (SerialPort) portId > .open( > TillInterfaceConstants.APPLICATION_NAME, > TillInterfaceConstants > .TIMEOUT_IN_MILLISECONDS_FOR_OPENING_OF_COMMUNICATION_PORT); > > // add an event listener which listens > // on the serial port and notifies the > // serial port object when input bytes > // have been received at the port > serialPort.addEventListener(tillInterfaceEventListener); > serialPort.notifyOnDataAvailable(true); > > // initialize the physical layer > // parameters of the serial port > serialPort.setSerialPortParams(TillInterfaceConstants.BAUD_RATE, > SerialPort.DATABITS_8, SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > // set the inter-character > // timeout (T2) > serialPort > .enableReceiveTimeout(TillInterfaceConstants.INTERCHARACTER_TIMEOUT_IN_MILLISECONDS); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > } else > throw new TillInterfaceSerialPortNotFoundException(); > } > > Any hint to solve this problem would be kindly appreciated. > The only thing that comes to mind here after looking at the offending function is rxtx used to include asm/termios.h but now we moved to termios.h and had glibc fix their headers. The asm/termios.h caused problems as its termios was smaller than the actual termios. This should be fixed in current rxtx versions but you can just glance at SerialImp.c and make sure it does not include asm/termios.h. I've cc'd the rxtx mail list because there was one other mention of stack problems recently. I have used rxtx on opteron systems with success. I have a bug I'm trying hard to reproduce on suse 64 bit (circa linux 2.4.19) systems though. So far I have not been able to reproduce the bug. That said, with gentoo... I like gentoo but I seriously doubt they do any QA with their kernel and Java. I've seen problems before. If you use gentoo and have Java problems, at least stick to Linus (that is an s there) kernels while using Java. I'm not an expert on gentoo but I've seen patches go into experimental kernels that turn out to break java and are reverted before going to Linus just before I see problems with gentoo on this list. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:16:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:16:14 +0100 (BST) Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: On Tue, 7 Jun 2005, David S. Acker wrote: > Hello, > I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our > product includes a built in USB to Serial adapter so that when it is > connected to your PC over USB, it appears as a serial port. We had problems > with Sun's comm library because it did not detect serial ports coming and > going properly. > > I did run into a few issues with RxTx though. I am building under Windows > (we support XP and 2000) under cygwin. I used a simple make file for the c > code that works under cygwin and ant to build the java stuff. Attached is a > diff file. The patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h for me. Also, > gcc didn't like a local file (win32termios.h) getting included with <> . > > RXTXPort.java - You can get an exception during the writeByte, writeArray, > nativeDrain, readByte, read, readArray, readTerminatedArray, and > nativeAvailable calls. Without this patch the IOLocked count gets stuck > incremented. > > termios.c - If you try to open a port through CreateFile and get > ERROR_ACCESS_DENIED it means someone else is using the port. We need to > make sure to use serial_close instead of just close. I found that some > devices finish their I/O synchronously. The code was treating this as an > error. I also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we must use quotes > and not <> to include win32termios.h . I also commented out a report call > since it seems to happen constantly on my system. > > Feel free to use these in any way that you want or just to ignore them. > Thanks! > Hi Dave These patches look great as is. Thanks. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:33:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:33:16 +0100 (BST) Subject: [Rxtx] Patch to IOLocked (fwd) Message-ID: This appears to be another solution to the locking. Chris, the other option just moves the locking into the finally clause which I think would be a little cleaner though I'm posting this patch to so people can comment. -- Trent Jarvi tjarvi at qbang.org ---------- Forwarded message ---------- Date: Wed, 1 Jun 2005 13:01:32 +0100 From: Christopher Dawes To: taj at www.linux.org.uk Subject: Patch to IOLocked Do you want me to check it out of CVS and then submit changes? Christopher -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXPort.java.diff Type: application/octet-stream Size: 6965 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/c442f9fc/RXTXPort.java-0401.obj From Christopher.Dawes at retail-logic.com Wed Jun 8 00:57:24 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 8 Jun 2005 07:57:24 +0100 Subject: [Rxtx] Patch to IOLocked (fwd) [Virus Checked] In-Reply-To: Message-ID: Agreed, much better Java :-) Thanks Christopher ------------------------------------------- Consultant Engineer Retail Logic Limited Fleet GU51 3TZ Tel: +44 (0)1252 644377 Mob: +44 (0)7899 842759 Fax: +44 (0)1252 776708 rxtx-bounces at mail.electronpusher.org wrote on 07/06/2005 21:33:16: > > This appears to be another solution to the locking. Chris, the other > option just moves the locking into the finally clause which I think would > be a little cleaner though I'm posting this patch to so people can > comment. > > -- > Trent Jarvi > tjarvi at qbang.org > > ---------- Forwarded message ---------- > Date: Wed, 1 Jun 2005 13:01:32 +0100 > From: Christopher Dawes > To: taj at www.linux.org.uk > Subject: Patch to IOLocked > > Do you want me to check it out of CVS and then submit changes? > > Christopher[attachment "RXTXPort.java.diff" deleted by Chris > Dawes/Retaillogic/NISABA] _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx From zempftman at gmail.com Wed Jun 8 07:57:25 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 09:57:25 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Maxwell Zempftman Date: May 27, 2005 5:01 PM Subject: Re: [Rxtx] Kaffe & rxtx & armv5b To: rxtx at mail.linuxgrrls.org Here are the results from working this week: The "NullPointerExceptions" are generated by the software when I choose a bad device file. I discovered that this occurs on the i686-RedHat box as well. This exception seems to be generated only by this particular application, and not by the example programs in contrib. So, for example: java MyApp /dev/null <-- generates NullPointerException java MyApp fake <-- generates NullPointerException java MyApp /dev/ttyS0 <-- does not generate NullPointerException Using the program CommCheck (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it appears as though /dev/ttyS0 is the only valid serial device file on the XScale device, so the errors I was getting are not really be bugs. Although /dev/ttyS0 did not generate NullPointerExceptions, I did encounter this error: --start java MyApp /dev/ttyS0 (going mostly from memory, not exact) PortList.hasMoreElements: true Listening on: /dev/ttyS0 Client connected. >From net: echo kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 vmExcept_setJNIFrame Assert: on 'fp != 0' failed. --end I took a look at exception.h, and it seems as though the problematic code does not exist in newer versions of Kaffe (I have been using CVS-2004-11). Next week I will try to use a newer version, although so far everything but CVS-2004-11 has failed. Also, I the device files I need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with something like this? Thanks, Max. > On 5/21/05, Trent Jarvi wrote: > > I'm not sure what is wrong in the first part. It sounds like your > > application may be swallowing an exception while trying to enumerate the > > port or open it. The usual mistake made it not having permissions to > > either open the port or create the lockfile. There should be examples in > > the contrib directory you can try that enumerate and open ports. Maybe > > that will give you some hints. > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > Sun's code limiting you there though you do need to compile and install > > rxtx for the XScale with Sun's Commapi. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > From taj at www.linux.org.uk Wed Jun 8 08:22:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 15:22:44 +0100 (BST) Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > ---------- Forwarded message ---------- > From: Maxwell Zempftman > Date: May 27, 2005 5:01 PM > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > To: rxtx at mail.linuxgrrls.org > > > Here are the results from working this week: > > The "NullPointerExceptions" are generated by the software when I > choose a bad device file. I discovered that this occurs on the > i686-RedHat box as well. This exception seems to be generated only by > this particular application, and not by the example programs in > contrib. So, for example: > > java MyApp /dev/null <-- generates NullPointerException > java MyApp fake <-- generates NullPointerException > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > Using the program CommCheck > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > appears as though /dev/ttyS0 is the only valid serial device file on > the XScale device, so the errors I was getting are not really be bugs. > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > encounter this error: > > --start > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > PortList.hasMoreElements: true > Listening on: /dev/ttyS0 > Client connected. > >From net: echo > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > --end > > I took a look at exception.h, and it seems as though the problematic > code does not exist in newer versions of Kaffe (I have been using > CVS-2004-11). Next week I will try to use a newer version, although so > far everything but CVS-2004-11 has failed. Also, I the device files I > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > something like this? > In RXTXCommDriver, just look for the following code and add /dev/ttyM to the list. Moxa? if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } So: if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyM", // for Moxa ports "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } Linux just has way too many port types to try enumerating them all. There is potential we can add them back in with udev now. > Thanks, > Max. > > > On 5/21/05, Trent Jarvi wrote: > > > I'm not sure what is wrong in the first part. It sounds like your > > > application may be swallowing an exception while trying to enumerate the > > > port or open it. The usual mistake made it not having permissions to > > > either open the port or create the lockfile. There should be examples in > > > the contrib directory you can try that enumerate and open ports. Maybe > > > that will give you some hints. > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > Sun's code limiting you there though you do need to compile and install > > > rxtx for the XScale with Sun's Commapi. > > > > > > -- > > > Trent Jarvi > > > tjarvi at qbang.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Wed Jun 8 12:16:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 08 Jun 2005 13:16:03 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A60B8D.8080500@cs.umn.edu> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> Message-ID: <42A735E3.8040706@atcorp.com> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual serial comport. This isn't so much of a problem, what is, however, is that the comport does not appear to be able to be set to any arbitrary speed, only those from the data_rate enum. I've not found much on using different speeds, has anyone else encountered anything similar? I greatly appreciate any and all comments and suggestions. Thanks in advance, ~ Shawn Lavelle From zempftman at gmail.com Wed Jun 8 12:50:58 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 14:50:58 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: Thanks Trent! That will solve one of the problems. I don't know when my next chance to work on it will be, but I still need to figure out the error I got when I tried opening '/dev/ttyS0' on the Moxa device regarding a failed assertion, seemed to be a Kaffe issue. Thanks for you help, hope to have results soon, Max Englander. On 6/8/05, Trent Jarvi wrote: > On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > > > ---------- Forwarded message ---------- > > From: Maxwell Zempftman > > Date: May 27, 2005 5:01 PM > > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > > To: rxtx at mail.linuxgrrls.org > > > > > > Here are the results from working this week: > > > > The "NullPointerExceptions" are generated by the software when I > > choose a bad device file. I discovered that this occurs on the > > i686-RedHat box as well. This exception seems to be generated only by > > this particular application, and not by the example programs in > > contrib. So, for example: > > > > java MyApp /dev/null <-- generates NullPointerException > > java MyApp fake <-- generates NullPointerException > > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > > > Using the program CommCheck > > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > > appears as though /dev/ttyS0 is the only valid serial device file on > > the XScale device, so the errors I was getting are not really be bugs. > > > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > > encounter this error: > > > > --start > > > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > > > PortList.hasMoreElements: true > > Listening on: /dev/ttyS0 > > Client connected. > > >From net: echo > > > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > > > --end > > > > I took a look at exception.h, and it seems as though the problematic > > code does not exist in newer versions of Kaffe (I have been using > > CVS-2004-11). Next week I will try to use a newer version, although so > > far everything but CVS-2004-11 has failed. Also, I the device files I > > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > > something like this? > > > > > In RXTXCommDriver, just look for the following code and add /dev/ttyM to > the list. Moxa? > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > So: > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyM", // for Moxa ports > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > Linux just has way too many port types to try enumerating them all. There > is potential we can add them back in with udev now. > > > > > Thanks, > > Max. > > > > > On 5/21/05, Trent Jarvi wrote: > > > > I'm not sure what is wrong in the first part. It sounds like your > > > > application may be swallowing an exception while trying to enumerate the > > > > port or open it. The usual mistake made it not having permissions to > > > > either open the port or create the lockfile. There should be examples in > > > > the contrib directory you can try that enumerate and open ports. Maybe > > > > that will give you some hints. > > > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > > Sun's code limiting you there though you do need to compile and install > > > > rxtx for the XScale with Sun's Commapi. > > > > > > > > -- > > > > Trent Jarvi > > > > tjarvi at qbang.org > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- > Trent Jarvi > tjarvi at qbang.org > From taj at www.linux.org.uk Wed Jun 8 12:53:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 19:53:10 +0100 (BST) Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A735E3.8040706@atcorp.com> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: On Wed, 8 Jun 2005, Shawn Lavelle wrote: > Hello, > I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate > with a virtual serial comport. This isn't so much of a problem, what > is, however, is that the comport does not appear to be able to be set to > any arbitrary speed, only those from the data_rate enum. I've not found > much on using different speeds, has anyone else encountered anything > similar? I greatly appreciate any and all comments and suggestions. > This problem is a bit more tricky than it should be. POSIX systems just have a few specified baud rates. Solaris is one of these systems. CommAPI baud rates probably came from someone looking at Solaris. RXTX tries to be POSIX like. W32 is treated as a POSIX like system via a termios.c file in rxtx. Serial ports have baudbase and divisor. So you can set these to come close to the baudrate you want. Some funky equipment like automobile test equipment use baud rates that are not really possible with PC hardware. But if you get as close as possible by changing baud base and divisor, it works. Windows can actually do this for you. I don't know exactly what their code does but if you pass a baudrate to windows, it will guestimate a baudbase and divisor. So you just pass it 10200 baud and it does its job. This is not of very much use the way rxtx does things though. Linux has the standard POSIX like baud rates but if you set the baud rate to B38400, you can set your own baud base and divisor. This is not POSIX that I know of. W32 has more capability than POSIX like systems too. So I did some work to have windows work like Linux via termios.c But the code is not quit right. SerialImp.c and termios.c need some work so all the various buadrates work on Linux and W32. Most other systems will not work beyond what CommAPI already specifies without writting kernel drivers. This is on my todo list but if someone gets to it first, all the better. -- Trent Jarvi tjarvi at qbang.org From carobizar at free.fr Thu Jun 9 06:39:10 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Thu, 9 Jun 2005 14:39:10 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: <1118320750.42a8386e6d3ce@imp5-q.free.fr> Hi ! Thank you for all your advices. I managed to use rxtx on Windows but I have still some difficulties on Linux. I have yet follow your instructions and the configure file has created : - librxtxSerial.so and librxtxParallel.so in the directory /usr/java/j2sdk1.4.2_08/jre/lib/i386 - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the directory /usr/java/j2sdk1.4.2_08/jre/lib - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext But when I run my program, Some exceptions occur : Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver So, 1) What have I forgotten ? 2) Is it possible to make my application run on Linux without the jdk (only the jre) ? Best regards, Caroline. From taj at www.linux.org.uk Thu Jun 9 07:28:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 9 Jun 2005 14:28:05 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118320750.42a8386e6d3ce@imp5-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: On Thu, 9 Jun 2005 carobizar at free.fr wrote: > Hi ! > Thank you for all your advices. > I managed to use rxtx on Windows but I have still some difficulties on Linux. > I have yet follow your instructions and the configure file has created : > - librxtxSerial.so and librxtxParallel.so in the directory > /usr/java/j2sdk1.4.2_08/jre/lib/i386 > - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the > directory /usr/java/j2sdk1.4.2_08/jre/lib > - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext > > But when I run my program, Some exceptions occur : > Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while > loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > com.sun.comm.SolarisDriver > > So, > 1) What have I forgotten ? > The native (.so) libraries are not installed in a directory the JRE is looking for native libraries in. You may look around and see where the .so libraries are in the JRE. I don't know that the jre/lib/i386 directory is specified as a required directory for JREs. I noticed some do not use it. You may try printing the java.libarary.path to see your options. It is also possible to alter the java.library.path. > 2) Is it possible to make my application run on Linux without the jdk (only the > jre) ? Yes. Though installation from source with the JDK is less error prone. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0398.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 7 15:03:09 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 07 Jun 2005 16:03:09 -0500 Subject: [Rxtx] Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <42A60B8D.8080500@cs.umn.edu> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual comport. This isn't so much of a problem, what is, however, is that the comport is only ever set to 9600 baud. I've not found this as a documented bug, has anyone else encountered anything similar? I'll try and provide more detail tomorrow, but if anyone has any suggestions or encountered this before, I'd like to hear about it. Thanks in advance, ~ Shawn Lavelle From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0401.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0401.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0401.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Mon Jun 20 01:04:40 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 20 Jun 2005 08:04:40 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: <42B66A88.4060806@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050620/9be208a1/attachment-0401.html From fbalzarro at libero.it Mon Jun 20 02:33:52 2005 From: fbalzarro at libero.it (Fabio Balzarro) Date: Mon, 20 Jun 2005 10:33:52 +0200 Subject: [Rxtx] RXTXPort:close detected bad file descriptor Message-ID: I'm using RXTX libraries on IPAQ 4150 PDA with Windows CE 4.20 and Jeode. When I close a serial port with sp.close() (where sp is a SerialPort) sometimes an error occour 1119256168085: RXTXPort:close detected bad file descriptor What can I do? Thanks Fabio ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From slavelle at atcorp.com Mon Jun 20 08:08:19 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 20 Jun 2005 09:08:19 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: <42B6CDD3.4040409@atcorp.com> It turns out that I did have a driver-not-used issue which has now been resolved and I can use RxTx on it (had to add ttyUSB as a valid port), but only at standard baud rates. Does USB have the same restrictions on port speed as regular RS232? ~ Shawn Trent Jarvi wrote: > Just a note here. > > I have requested a FTDI usb device and they offered to send one for the > purpose of trying to get rxtx working. I have no idea how long that takes > though. > > > On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > > >>I'm afraid we're just using the latest version from the FTDI website. I've >>not yet played with linux properly with this and unfortunately I run gentoo >>and haven't yet successfully compiled in the ftdi driver. I'll let you know >>if I get any success. >> >>Appologies >> >>Christopher >> >>-----Original Message----- >>From: rxtx-bounces at mail.electronpusher.org >>[mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle >>Sent: 15 June 2005 00:00 >>To: Java RXTX discussion >>Subject: Re: [Rxtx] Virtual Com Ports >> >>Hmm, the latter sounds like a lot of work. It does find the virtual comport >>in windows, i must have just missed it earlier (sign of a long day). On the >>linux side, I suspect that something is not correct with the driver >>installation becuase it does not give me a tty for it :( >> >>Christopher, May I ask what driver you are using for your FTDI chip? >>Did you ever encounter problems with not getting a tty assigned for it? >> >> >> Thanks for all your help! >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>They will have to show up as a tty device in Linux. Probably ttyUSB? >>>That will need an entry in RXTXCommDriver.java. If they dont show up >>>as a tty device, rxtx cant treat it like a serial port. It just wont >> >>work. >> >>>With COM3, rxtx will try to open the port and perform a timed out read. >>>Usually if a port is not there, the read blows up or the open blows up. >>>Timing out is fine. COM3 used to share interrupts with COM1. I know >>>you can reassign ports in XP. RXTX scans up through COM255. You may >>>try moving it. >>> >>> >>>The code in question is the following in RXTXCommDriver.java >>> >>> >>> if(osName.equals("Linux")) >>> { >>> String[] Temp = { >>> "ttyS", // linux Serial Ports >>> "ttySA", // for the IPAQs >>> "ttyUSB" // for USB frobs >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>> else if(osName.toLowerCase().indexOf("windows") != -1 ) >>> { >>> String[] Temp = { >>> "COM" // win32 serial ports >>> //"//./COM" // win32 serial ports >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>>If COM3 can be read, it should be found. the ttyUSB should work if >>>thats in the version of RXTXCommDriver.java you have. >>> >>>If this is still a problem, it may be that the driver is erroring on >>>what may be considered normal comm port operations such as setting the >>>speed, timeout, threshold, .. One would have to start looking at each >>>function called in the native open() and read(). >>> >>> >>> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>>seems to find the device using rxtx. Looking at the hardware >>>>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>>>linux. I can't seem to get it to show up as a tty(s#) in linux which >>>>is probably just due to my lack of significant linux knowledge. >>>> >>>> ~ Shawn >>>> >>>>Trent Jarvi wrote: >>>> >>>> >>>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>Has anyone here noticed that virtual comports do not get enumerated >>>>>>via CommPortIdentifier.getPortIdentifiers()?? >>>>>> >>>>>>The device I'm trying to talk to uses an fdti usb to serial >>>>>>convertor with a driver that has it show up as a virtual comport. I >>>>>>can enter this port manually and it will be usable but I cannot get >>>>>>it show up automatically (as in the simple serial demo). Any thoughts >> >>on this? >> >>>>> >>>>>Hi Shawn, >>>>> >>>>>What OS is this and what is the name of the virtual port you are >>>>>trying to open? I suspect the name just needs to be added to >> >>RXTXCommDriver.java. >> >>>>_______________________________________________ >>>>Rxtx mailing list >>>>Rxtx at mail.electronpusher.org >>>>http://www.electronpusher.org/mailman/listinfo/rxtx >>>> >>> >>> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From lyon at docjava.com Mon Jun 20 15:06:08 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 20 Jun 2005 17:06:08 -0400 Subject: [Rxtx] testing Message-ID: Hi All, I am testing my new multi-platform Java Webstart RXTX application (Trent: I could not have done it without you!). So far, I think it will work under Linux (x86), Windows XP, Windows 2000 and MacOS X. The application is available as a Java webstart application at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Edit:Preferences: SerialPort Setup... should bring up a dialog box that enables dialing via the modem. Generally, it does not find internal modems (except on the mac). Why, I don't know. Thanks in advance for trying this new app. All feedback on it is welcome. - Doug Lyon From jasmine at electronpusher.org Tue Jun 21 04:15:53 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Tue, 21 Jun 2005 11:15:53 +0100 Subject: [Rxtx] testing In-Reply-To: References: Message-ID: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > Hi All, > I am testing my new multi-platform Java Webstart RXTX application > (Trent: I could not have done it without you!). > > So far, I think it will work under Linux (x86), Windows XP, > Windows 2000 and MacOS X. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. -J. From taj at www.linux.org.uk Tue Jun 21 05:50:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 12:50:23 +0100 (BST) Subject: [Rxtx] testing In-Reply-To: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> References: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> Message-ID: On Tue, 21 Jun 2005, Jasmine Strong wrote: > > On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > > > Hi All, > > I am testing my new multi-platform Java Webstart RXTX application > > (Trent: I could not have done it without you!). > > > > So far, I think it will work under Linux (x86), Windows XP, > > Windows 2000 and MacOS X. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > on my Mac. > passing -source 1.3 -target 1.3 to javac will compile classes without this problem. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 10:19:25 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 11:19:25 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. Sincerely, Jeremyah Payne From ricardo.trindade at emation.pt Tue Jun 21 13:25:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 20:25:00 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B8698C.2060509@emation.pt> Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > From taj at www.linux.org.uk Tue Jun 21 13:39:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:39:43 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <42B8698C.2060509@emation.pt> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> <42B8698C.2060509@emation.pt> Message-ID: It looks like he has an rs422 device/converter. This is not the problematic 'trying to do protocol X with a serial port' situation unless I'm missing something. I'll follow up with the other email I started. On Tue, 21 Jun 2005, Ricardo Trindade wrote: > Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. > > Payne, Jeremyah L (N-CIM) wrote: > > >Good morning, my name is Jeremyah and I am working on a java project to > >interface with some devices. In short, I have a laptop with a PCMIA > >converter that does RS422 running windows 2000. I also will be > >installing some PCI cards into some Linux boxes that will have probably > >4-8 RS422 ports on them. After doing some reading in order to talk > >with these items using my existing java code I will need an additional > >driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > >trying to get a map sort of where I need to make changes. As I see it, > >I would need to subclass SerialPort to my RS422 interface. That would > >link with a DLL or SO implementation that talks with the hardware. I > >also need to change the listing of working ports in the lookup section > >for serial. Does this seem like I am on the right track? Appreciate > >the support. > > > > > >Sincerely, > >Jeremyah Payne > >_______________________________________________ > >Rxtx mailing list > >Rxtx at mail.electronpusher.org > >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 21 13:40:25 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:40:25 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: On Tue, 21 Jun 2005, Payne, Jeremyah L (N-CIM) wrote: > Good morning, my name is Jeremyah and I am working on a java project to > interface with some devices. In short, I have a laptop with a PCMIA > converter that does RS422 running windows 2000. I also will be > installing some PCI cards into some Linux boxes that will have probably > 4-8 RS422 ports on them. After doing some reading in order to talk with > these items using my existing java code I will need an additional > driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > trying to get a map sort of where I need to make changes. As I see it, I > would need to subclass SerialPort to my RS422 interface. That would link > with a DLL or SO implementation that talks with the hardware. I also > need to change the listing of working ports in the lookup section for > serial. Does this seem like I am on the right track? Appreciate the > support. > Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 13:40:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 14:40:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618954@emss02m08.us.lmco.com> I'd like to except I am dealing with NASA. I am basically building a system to monitor 100+ Units that communicate over RS422. They have some converters in place but want to get rid of them. I'll check through the archives. I had started looking yesterday as was leaving work. -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Ricardo Trindade Sent: Tuesday, June 21, 2005 2:25 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From slavelle at atcorp.com Tue Jun 21 14:58:06 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 21 Jun 2005 15:58:06 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: <42B87F5E.4000403@atcorp.com> > Linux has the standard POSIX like baud rates but if you set the baud rate > to B38400, you can set your own baud base and divisor. This is not POSIX > that I know of. W32 has more capability than POSIX like systems too. So > I did some work to have windows work like Linux via termios.c > > But the code is not quit right. SerialImp.c and termios.c need some > work so all the various buadrates work on Linux and W32. Most other > systems will not work beyond what CommAPI already specifies without > writting kernel drivers. > > This is on my todo list but if someone gets to it first, all the better. Hmm, I guess I didn't read this close enough before. Just to be clear, the pieces to setBaudBase and setDivisor are not yet implemented, correct? Thanks, Shawn From sean_montgomery at baseview.com Tue Jun 21 15:14:08 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 21 Jun 2005 17:14:08 -0400 Subject: [Rxtx] OS X installation - file locations Message-ID: <8AB82C7F-0D19-45F9-AE54-A12C59A8495E@baseview.com> Greetings, I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) using the RXTX installation instructions. RXTX worked fine. Basically you've got: - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions - javax.comm.properties in /System/Library/Frameworks/ JavaVM.framework/Home/lib - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ lib/ext My coworker was concerned that the installation required files to be placed in /System/Library... because those directories are "Apple's" and subject to change at Apple's whim, and that it would be safer (less likely to break when a user updates their OS or Java version or what have you) if all the files could be somewhere in /Library... or / Library/Java. My coworker points out that when 3rd party apps like FrontBase and JBoss need to communicate with Java their jars are placed in /Library/Java/Extensions. Granted that RXTX 2.0 is implementing javax.comm and not just a 3rd party extension, might that be the case - that javax.* stuff needs to be in the Java system files? I'm not the Java maven that my coworker is, so I don't know if any of this is gospel or not. Any OS X/Java experts out there willing to comment? We'd like to be able to install RXTX in the safest, most maintenance free way possible, but if there are specific reasons why javax.comm.properties and comm.jar need to be in /System... then so be it. Any information is welcome, Sean From ricardo.trindade at emation.pt Tue Jun 21 15:56:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 22:56:53 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B88D25.7060604@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050621/f6c9f5fe/attachment-0401.html From jeremyah.l.payne at lmco.com Tue Jun 21 15:22:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 16:22:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618955@emss02m08.us.lmco.com> -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Trent Jarvi Sent: Tuesday, June 21, 2005 2:40 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 As of yet we have not decided on the PCI boards to use yet So I am still waiting to se how we will interface to them. But the laptop is ready to use so ill build a test app for that API for now. The overview of class structure is really what I needed. I guess I will use the 2.1 as you suggested. Thanks for the help thus far! BTW, you guys wouldn't happen to keep class diagrams or anything of that nature around would you? If not I will probably end up having to do some anyway for documentation purposes, I could include them. Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From dmarkman at mac.com Tue Jun 21 18:13:28 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 21 Jun 2005 20:13:28 -0400 Subject: [Rxtx] OS X installation - file locations In-Reply-To: References: Message-ID: <044F520C-585C-4B99-82ED-3BA83DB8CE77@mac.com> Apple doesn't recommend to put jars into the /System/Library/Frameworks/JavaVM.framework/Home/lib/ext folder from other hands it's standard java directory to put extentions if you want to support comm api on whole system then I'd recommend to put jars into the /Library/Java/Extensions folder just like you did if you want to support comm api per user put your jars into the ~/ Library/Java/Extensions On Jun 21, 2005, at 5:14 PM, Java RXTX discussion wrote: > Greetings, > > > I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) > using the RXTX installation instructions. RXTX worked fine. > > > Basically you've got: > - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions > - javax.comm.properties in /System/Library/Frameworks/ > JavaVM.framework/Home/lib > - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ > lib/ext > > > My coworker was concerned that the installation required files to be > placed in /System/Library... because those directories are "Apple's" > and subject to change at Apple's whim, and that it would be safer > (less likely to break when a user updates their OS or Java version or > what have you) if all the files could be somewhere in /Library... or / > Library/Java. My coworker points out that when 3rd party apps like > FrontBase and JBoss need to communicate with Java their jars are > placed in /Library/Java/Extensions. Granted that RXTX 2.0 is > implementing javax.comm and not just a 3rd party extension, might > that be the case - that javax.* stuff needs to be in the Java system > files? > > > I'm not the Java maven that my coworker is, so I don't know if any of > this is gospel or not. Any OS X/Java experts out there willing to > comment? We'd like to be able to install RXTX in the safest, most > maintenance free way possible, but if there are specific reasons why > javax.comm.properties and comm.jar need to be in /System... then so > be it. > > > Any information is welcome, > > > Sean > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Dmitry Markman Dmitry Markman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050622/beea65d0/attachment-0401.html From lyon at docjava.com Thu Jun 23 04:39:47 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 23 Jun 2005 06:39:47 -0400 Subject: [Rxtx] web start + RXTX = strange errors? Message-ID: On: Date: Tue, 21 Jun 2005 11:15:53 +0100 From: Jasmine Strong Writes: An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. ----------- I cannot duplicate your error. My version of Java is: java -version java version "1.4.2_05" Is yours the same? Trent: You wrote: passing -source 1.3 -target 1.3 to javac will compile classes without this problem. ----------- OK, I have updated the disto to work with jdk1.3: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Jasmine: Is this working any better? Thanks! - DL From handzisk at tkn.tu-berlin.de Fri Jun 24 02:37:14 2005 From: handzisk at tkn.tu-berlin.de (Vlado Handziski) Date: Fri, 24 Jun 2005 10:37:14 +0200 (CEST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace Message-ID: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Hi all, let me first express my compliments on the great work you have done with the RXTX library. We have been using the library for some time, and we are at a point where we want to make our code public. For legacy reasons, the code that the RXTX library is bundled with, uses the javax.comm namespace. We have been using the ChangePackage script to change the RXTX2.1 package from gnu.io into javax.comm. We need the independent implementation since we want to be able to directly access /dev/ttyUSBx ports in linux and the CommAPI versions are just not as stable. On the download page, there is a comment that this is in violation of sun's license. Can someone shed more light on this. I was not aware that you can protect the names of the java packages. Best regards, Vlado From ricardo.trindade at emation.pt Fri Jun 24 04:01:17 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 11:01:17 +0100 Subject: [Rxtx] parity missed Message-ID: <42BBD9ED.3060004@emation.pt> Hi, I have a "parity missed error". From previous posts I believe this has to do with CMSPAR not being defined. I checked out 2.1 head from CVS. How can I make sure I do a proper build and CMSPAR is defined ? Perhaps it would be good to have a release snapshot that has this, I think the latest snapshot (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. Another question I have, is why must this depend on kernel headers, why can't it be defined in the RXTX source ? thanks Ricardo From jasmine at electronpusher.org Fri Jun 24 04:09:06 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 24 Jun 2005 11:09:06 +0100 Subject: [Rxtx] web start + RXTX = strange errors? In-Reply-To: References: Message-ID: <644aad2bdbba950f0a2fb12d7dcfd8a6@electronpusher.org> On 23 Jun 2005, at 11:39, Dr. Douglas Lyon wrote: > OK, I have updated the disto to work with jdk1.3: > http://show.docjava.com:8086/book/cgij/code/jnlp/ > addbk.JAddressBook.Main.jnlp > > Jasmine: Is this working any better? Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) -J. From taj at www.linux.org.uk Fri Jun 24 10:54:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 17:54:12 +0100 (BST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: On Fri, 24 Jun 2005, Vlado Handziski wrote: > Hi all, > > let me first express my compliments on the great work you have done with > the RXTX library. > > We have been using the library for some time, and we are at a point where > we want to make our code public. For legacy reasons, the code that the > RXTX library is bundled with, uses the javax.comm namespace. We have been > using the ChangePackage script to change the RXTX2.1 package from gnu.io > into javax.comm. We need the independent implementation since we want to > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > versions are just not as stable. > > On the download page, there is a comment that this is in violation of > sun's license. Can someone shed more light on this. I was not aware that > you can protect the names of the java packages. > > Best regards, > Vlado > I can't provide legal advice as I am not a lawyer. (v) may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are contained in the "java", "javax" or "sun" packages or similar as specified by Sun in any class file naming convention; and The license is in the commapi package from Sun. The above is also in all the EULA's you click through to download from Sun if I'm not mistaken. Simply put, the license taints developers that agree to it. For those developers, Sun has control of the javax.comm namespace. It really does not make sense to put rxtx 2.1 in the javax.comm namespace. It will only cause confusion which I think is the point of the clause above. The gnu.io namespace was perhaps a poor choice and just tossed in when reviewing the license to get out of Sun's namespace. There is nothing in the rxtx license limiting your freedom in this fashion though. Many companies are moving to gnu.io and some distribute it with popular applications you would recognize. I'm tempted to ask you not to contaminate rxtx 2.1 with the javax.comm namespace. You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) extensions to existing classes (which I dont think you are using); it is not just javax.comm. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 24 13:24:09 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 20:24:09 +0100 (BST) Subject: [Rxtx] parity missed In-Reply-To: <42BBD9ED.3060004@emation.pt> References: <42BBD9ED.3060004@emation.pt> Message-ID: On Fri, 24 Jun 2005, Ricardo Trindade wrote: > Hi, > > I have a "parity missed error". From previous posts I believe this > has to do with CMSPAR not being defined. > I checked out 2.1 head from CVS. How can I make sure I do a proper > build and CMSPAR is defined ? Perhaps it would be good to have a release > snapshot that has this, I think the latest snapshot > (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. > > Another question I have, is why must this depend on kernel headers, > why can't it be defined in the RXTX source ? > I used to cheat and grab the CMSPAR from the kernel headers because glibc did not have it. Now rxtx uses the glibc headers and we have a patch in glibc I trust that handles this. It would not be right to override glibc and it wasnt right to use the kernel headers (it really did cause problems). You can override glibc for now with the following in the top of SerialImp.c # define CMSPAR 010000000000 You can check if your distro headers have this right bit looking for the above in bits/termios.h. It should look like this: #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif If it is not defined, please file a bug with your distro as rxtx is not the only thing that will be broken on that distro. I was going to release new cvs snapshots last weekend but got tied up. I'll do it this weekend. I also need to get custom baudrate patches into the cvs snapshot. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Fri Jun 24 13:56:50 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 20:56:50 +0100 Subject: [Rxtx] parity missed In-Reply-To: References: <42BBD9ED.3060004@emation.pt> Message-ID: <42BC6582.2070805@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050624/e3b39631/attachment-0401.html From vlado.handziski at gmail.com Sat Jun 25 06:25:52 2005 From: vlado.handziski at gmail.com (Vlado Handziski) Date: Sat, 25 Jun 2005 14:25:52 +0200 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: <697986ec05062505256ebf381f@mail.gmail.com> Thanks for the clarification. Since changing the bundled source is not an option at this moment, we will consider using javax.comm and RXTX2.0. In the next rewrite, we would probably move to gnu.io . Best regards, Vlado Handziski On 6/24/05, Trent Jarvi wrote: > > On Fri, 24 Jun 2005, Vlado Handziski wrote: > > > Hi all, > > > > let me first express my compliments on the great work you have done with > > the RXTX library. > > > > We have been using the library for some time, and we are at a point > where > > we want to make our code public. For legacy reasons, the code that the > > RXTX library is bundled with, uses the javax.comm namespace. We have > been > > using the ChangePackage script to change the RXTX2.1 package from gnu.io > > into javax.comm. We need the independent implementation since we want to > > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > > versions are just not as stable. > > > > On the download page, there is a comment that this is in violation of > > sun's license. Can someone shed more light on this. I was not aware that > > you can protect the names of the java packages. > > > > Best regards, > > Vlado > > > > I can't provide legal advice as I am not a lawyer. > > (v) may not create, or authorize your licensees to create additional > classes, interfaces, or subpackages that are contained in the "java", > "javax" or "sun" packages or similar as specified by Sun in any class file > naming convention; and > > The license is in the commapi package from Sun. The above is also in all > the EULA's you click through to download from Sun if I'm not mistaken. > > Simply put, the license taints developers that agree to it. For those > developers, Sun has control of the javax.comm namespace. > > It really does not make sense to put rxtx 2.1 in the javax.comm namespace. > It will only cause confusion which I think is the point of the clause > above. The gnu.io namespace was perhaps a poor choice and > just tossed in > when reviewing the license to get out of Sun's namespace. > > There is nothing in the rxtx license limiting your freedom in this fashion > though. Many companies are moving to gnu.io and some > distribute it with > popular applications you would recognize. I'm tempted to ask you not > to contaminate rxtx 2.1 with the javax.comm namespace. > > You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm > using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) > extensions to existing classes (which I dont think you are using); it is > not just javax.comm. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050625/1dadc50e/attachment-0401.html From taj at www.linux.org.uk Sun Jun 26 11:34:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 26 Jun 2005 18:34:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. Message-ID: The attached file should fix baud_base and divisor extensions for Linux The patch is against rxtx 2.1 CVS HEAD. To use this patch, you should set the baud rate to 38400. You can then try SerialPort.setBaudBase(int) and SerialPort.setDivisor(int) There are matching int SerialPort.getBaudBase() and int SerialPort.getDivisor(). What baud bases are available depends upon the serial port card and its driver so this is a bit of a blind attempt on my part. I've looked at the w32 API and I dont see anything available yet. The w32 code in RXTX will probably be figuring out the baud rate based on the tried baud base and divisor and just slamming it at the API for now (the API does something with that but I've not found real documentation on what it does). I dont want to try tinkering with the UART directly yet as that would involve poking machine memory directly and could very easily be error prone in bad ways. I don't expect Solaris or any SysV UNIX systems to work at all with this - ever. It is not standard in any way and will throw Exceptions on everything but Linux (w32 will just fail miserably as it is 1/2 implemented). If anyone has looked at custom baud rates before and has some thoughts or just wants to try the attached untested patch, I'd appreciate any feedback. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- ? autom4te.cache ? build ? output cvs server: Diffing . Index: configure =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure,v retrieving revision 1.35.2.59 diff -u -r1.35.2.59 configure --- configure 16 Oct 2004 16:20:34 -0000 1.35.2.59 +++ configure 26 Jun 2005 16:59:28 -0000 @@ -9644,6 +9644,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { #if defined (__GLIBC__) @@ -9782,6 +9784,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { @@ -9825,7 +9829,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -9837,7 +9841,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 26 Jun 2005 16:59:28 -0000 @@ -218,6 +218,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { #if defined (__GLIBC__) @@ -356,6 +358,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { @@ -399,7 +403,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -411,7 +415,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" cvs server: Diffing CNI cvs server: Diffing MACOSX_IDE cvs server: Diffing MACOSX_IDE/CW cvs server: Diffing MACOSX_IDE/ForPackageMaker cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions cvs server: Diffing MACOSX_IDE/ForPackageMaker/Resources cvs server: Diffing MACOSX_IDE/PB cvs server: Diffing WinCE cvs server: Diffing contrib cvs server: Diffing debian cvs server: Diffing src Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 26 Jun 2005 16:59:29 -0000 @@ -2079,15 +2079,17 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int BaudBase The clock frequency divided by 16. Default * BaudBase is 115200. * @return boolean true on success - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:setBaudBase()"); @@ -2097,10 +2099,11 @@ /** * Extension to CommAPI * @return int BaudBase - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getBaudBase() throws UnsupportedCommOperationException + public int getBaudBase() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getBaudBase()"); @@ -2108,13 +2111,14 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, IOException { if ( debug ) z.reportln( "RXTXPort:setDivisor()"); @@ -2124,10 +2128,11 @@ /** * Extension to CommAPI * @returns int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getDivisor() throws UnsupportedCommOperationException + public int getDivisor() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getDivisor()"); Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 26 Jun 2005 16:59:30 -0000 @@ -1877,16 +1877,27 @@ int fd = get_java_var( env, jobj,"fd","I" ); struct serial_struct sstruct; + if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) + { + goto fail; + } + + sstruct.baud_base = (int) BaudBase; + if ( sstruct.baud_base < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetBaudBase", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetBaudBase", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1914,9 +1925,13 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) ( sstruct.baud_base ) ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetBaudBase", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetBaudBase", strerror( errno ) ); @@ -1950,19 +1965,23 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } if ( sstruct.custom_divisor < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetDivisor", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetDivisor", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1971,7 +1990,7 @@ accept: none perform: Find the Divisor used for custom speeds - return: Divisor + return: Divisor negative value on error. exceptions: Unsupported Comm Operation on systems not supporting TIOCGSERIAL comments: @@ -1990,10 +2009,14 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) sstruct.custom_divisor ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetDivisor", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetDivisor", strerror( errno ) ); @@ -2032,7 +2055,7 @@ /* Open and lock the port so nothing else changes the setting */ - if ( LOCK( filename, pid ) ) goto fail;; + if ( LOCK( filename, pid ) ) goto fail; fd = find_preopened_ports( filename ); if( !fd ) Index: src/SerialPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/Attic/SerialPort.java,v retrieving revision 1.3.2.9 diff -u -r1.3.2.9 SerialPort.java --- src/SerialPort.java 12 Oct 2004 08:59:28 -0000 1.3.2.9 +++ src/SerialPort.java 26 Jun 2005 16:59:30 -0000 @@ -103,13 +103,17 @@ public abstract String getUARTType() throws UnsupportedCommOperationException; public abstract boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getBaudBase() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getDivisor() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setLowLatency() throws UnsupportedCommOperationException; public abstract boolean getLowLatency() cvs server: Diffing src/lfd cvs server: Diffing src/psmisc From uwe at kubosch.no Mon Jun 27 14:13:57 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Mon, 27 Jun 2005 22:13:57 +0200 Subject: [Rxtx] RXTX on FC4 Message-ID: <1119903238.2989.27.camel@BPC0276> Hi all! I just got RXTX to work on Fedora Core 4. The standard download did not work. I had to check the code out from CVS and build it, but then it worked flawlessly. Thanks for your good work. Now I wonder if I should contribute the compiled files so that others will have an easier time than me getting RXTX to work on FC4. What do I do? Who do I talk to? donV From taj at www.linux.org.uk Mon Jun 27 14:29:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 27 Jun 2005 21:29:46 +0100 (BST) Subject: [Rxtx] RXTX on FC4 In-Reply-To: <1119903238.2989.27.camel@BPC0276> References: <1119903238.2989.27.camel@BPC0276> Message-ID: On Mon, 27 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I just got RXTX to work on Fedora Core 4. > > The standard download did not work. > > I had to check the code out from CVS and build it, but then it worked > flawlessly. > > Thanks for your good work. > > Now I wonder if I should contribute the compiled files so that others > will have an easier time than me getting RXTX to work on FC4. What do I > do? Who do I talk to? > > The best thing to do with FC is to contibute an extras RPM. Debian does something like this with their .deb packaging. As rxtx is OS neutral, it is almost impossible to have everything on rxtx.org. If you do get a package in Fedora Extras, I can point a link there. The extra's mail list is here: https://www.redhat.com/mailman/listinfo/fedora-extras-list If it would help to have me release a 'stable' .tar.gz of the source for the RPM submittal process I can do that. It would also trigger upgrades in debian which would not be bad. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Mon Jun 27 16:23:20 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 27 Jun 2005 17:23:20 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: Message-ID: <42C07C58.1030608@atcorp.com> Hey Trent, I installed it and now I get IOExceptions instead of the other one. I'm not sure how those changes would have enabled setDivisor and setBaudBase to work though. Is it significant that this is a USB device emulating a serial port? ~ Shawn From taj at www.linux.org.uk Mon Jun 27 18:07:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 01:07:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: <42C07C58.1030608@atcorp.com> References: <42C07C58.1030608@atcorp.com> Message-ID: On Mon, 27 Jun 2005, Shawn Lavelle wrote: > Hey Trent, > I installed it and now I get IOExceptions instead of the other one. > I'm not sure how those changes would have enabled setDivisor and > setBaudBase to work though. Is it significant that this is a USB device > emulating a serial port? > The USB driver probably does not support this. With USB, the ioctl()'s appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through the linux drivers/usb tree and found to ioctl to support this in Linux 2.6.10. RXTX is not doing very much magic, the patch really only gets the serial struct instead of writing a structure with random values for baudbase and handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel level driver issue not a user space library issue. So if you wanted this to work, the usb serial driver would have to handle the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression after looking through the USB tree quickly. I hope that helps. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Jun 27 18:25:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 27 Jun 2005 20:25:22 -0400 Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) Message-ID: Hi All, I wrote: Jasmine: Is this working any better? And Jasmine says: Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) I am using -source 1.3 and -target 1.3 for the compilation, however, we still seem to have this problem, which my machine (for some reason) does not have. Does anyone have any ideas about what might be the problem? Thanks! - DL From taj at www.linux.org.uk Mon Jun 27 19:04:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 02:04:37 +0100 (BST) Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) In-Reply-To: References: Message-ID: On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I wrote: > Jasmine: Is this working any better? > > And Jasmine says: > Nope. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > > I am using -source 1.3 and -target 1.3 > for the compilation, however, we still seem to have this problem, > which my machine (for some reason) does not have. > Does anyone have any ideas about what might be the problem? > This has shown up in the past with jdk 1.5 compiled jars running on jre 1.4 machines. My guess is either jasmine has an old copy of rxtx with the problem on her machine that is being picked up on the classpath or you have not tried this with jre 1.4. The suggested -source/target fix should avoid the problem. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Mon Jun 27 21:23:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 04:23:55 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: On Tue, 28 Jun 2005, Trent Jarvi wrote: > On Mon, 27 Jun 2005, Shawn Lavelle wrote: > > > Hey Trent, > > I installed it and now I get IOExceptions instead of the other one. > > I'm not sure how those changes would have enabled setDivisor and > > setBaudBase to work though. Is it significant that this is a USB device > > emulating a serial port? > > > > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > > RXTX is not doing very much magic, the patch really only gets the serial > struct instead of writing a structure with random values for baudbase and > handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel > level driver issue not a user space library issue. > > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. > > I hope that helps. > > > It may be possible that you can just modify translate_speed and get_java_baudrate in SerialImp.c to have the new high speds you are after. The defines are in /usr/include/termios.h. #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 You can see many of these are not handled. I dont think CommAPI handled more than 57600 or so. int get_java_baudrate( int native_speed ) { switch( native_speed ) { case B0: return 0; case B50: return 50; case B75: return 75; case B110: return 110; case B134: return 134; case B150: return 150; case B200: return 200; case B300: return 300; case B600: return 600; case B1200: return 1200; case B1800: return 1800; case B2400: return 2400; case B4800: return 4800; case B9600: return 9600; case B19200: return 19200; case B38400: return 38400; case B57600: return 57600; default: return -1; } } int translate_speed( JNIEnv *env, jint speed ) { LEAVE( "RXTXPort:translate_speed" ); switch( speed ) { case 0: return B0; case 50: return B50; case 75: return B75; case 110: return B110; case 134: return B134; case 150: return B150; case 200: return B200; case 300: return B300; case 600: return B600; case 1200: return B1200; case 1800: return B1800; case 2400: return B2400; case 4800: return B4800; case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; #ifdef B57600 case 57600: return B57600; #endif /* B57600 */ #ifdef B115200 case 115200: return B115200; #endif /* B115200 */ #ifdef B230400 case 230400: return B230400; #endif /* B230400 */ #ifdef B460800 case 460800: return B460800; #endif /* B460800 */ #ifdef B14400 case 14400: return B14400; #endif /* B14400 */ #ifdef B28800 case 28800: return B28800; #endif /* B28800 */ #ifdef B128000 /* dima */ case 128000: return B128000; #endif /* dima */ #ifdef B256000 /* dima */ case 256000: return B256000; #endif /* dima */ } /* Handle custom speeds */ if( speed >= 0 ) return speed; else { LEAVE( "RXTXPort:translate_speed: Error condition" ); return -1; } } -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 28 05:20:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 28 Jun 2005 07:20:21 -0400 Subject: [Rxtx] cross-compilation using Make for Mac Message-ID: Hi All, Please excuse the long post; Trent said: >" >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. " Here is what I have on the mac version: java -version java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) When I run: http://show.docjava.com:8086/book/cgij/code/jnlp/math.benchmarks.Dhry.jnlp I get: -- listing properties -- jnlpx.heapsize=NULL,NULL jnlpx.splashport=-1 java.runtime.name=Java(TM) 2 Runtime Environment, Stand... java.protocol.handler.pkgs=com.sun.javaws.net.protocol sun.boot.library.path=/System/Library/Frameworks/JavaVM.fra... java.vm.version=1.4.2-38 awt.nativeDoubleBuffering=true gopherProxySet=false http.auth.serializeRequests=true java.vm.vendor="Apple Computer, Inc." java.vendor.url=http://apple.com/ path.separator=: java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io jnlpx.home=/Applications/Utilities/Java/Java Web... user.country=US sun.os.patch.level=unknown java.vm.specification.name=Java Virtual Machine Specification user.dir=/ java.runtime.version=1.4.2_05-141.4 java.awt.graphicsenv=apple.awt.CGraphicsEnvironment java.endorsed.dirs=/System/Library/Frameworks/JavaVM.fra... os.arch=ppc java.io.tmpdir=/tmp line.separator= java.vm.specification.vendor=Sun Microsystems Inc. jnlpx.remove=false os.name=Mac OS X sun.java2d.fontpath= java.library.path=/Applications/Utilities/Java/Java Web... java.specification.name=Java Platform API Specification java.class.version=48.0 jnlpx.deployment.user.home=/Users/lyon/Library/Caches/Java Web S... java.util.prefs.PreferencesFactory=java.util.prefs.MacOSXPreferencesFactory os.version=10.3.9 user.home=/Users/lyon user.timezone=America/New_York java.security.policy=file:/Applications/Utilities/Java/Jav... java.awt.printerjob=apple.awt.CPrinterJob trustProxy=true java.specification.version=1.4 file.encoding=MacRoman jnlpx.deployment.system.home=/Applications/Utilities/Java/J2SE 5.0... user.name=lyon java.class.path=/Applications/Utilities/Java/Java Web... java.vm.specification.version=1.0 sun.arch.data.model=32 java.home=/System/Library/Frameworks/JavaVM.fra... java.specification.vendor=Sun Microsystems Inc. user.language=en awt.toolkit=apple.awt.CToolkit java.vm.info=mixed mode java.version=1.4.2_05 java.ext.dirs=/Users/lyon/Library/Java/Extensions:/... sun.boot.class.path=/System/Library/Frameworks/JavaVM.fra... java.vendor=Apple Computer, Inc. file.separator=/ java.vendor.url.bug=http://developer.apple.com/java/ sun.cpu.endian=big sun.io.unicode.encoding=UnicodeBig mrj.version=141.3 jnlpx.jvm=/System/Library/Frameworks/JavaVM.fra... sun.cpu.isalist= sun.awt.exception.handler=apple.awt.CToolkit$EventQueueExceptio... javawebstart.version=javaws-1.4.2_05 800 mhz g4,878k ds/sec total time: 1184ms Result: 844594 dhrystone/sec. Load average for last 15 minutes:0.62 So, I feel pretty sure that I have tried this with 1.4. As to modifying the RXTX compilation, that I did not do...and I take your point. I have been using the binary distributions as is. Oops. I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Now when I do a make, I get: make gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known libtool: link: warning: undefined symbols not allowed in i386-pc-mingw32 shared libraries rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ln: `SerialImp.o': File exists make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 So, I do a make clean, then a make: .... (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ar cru .libs/librxtxSerial.a /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o ar: /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o: No such file or directory make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 In the i386 directory, there is a symbolic link left from something: ls -al SerialImp.o lrwxrwxrwx 1 lyon lyon 12 Jun 28 07:03 SerialImp.o -> SerialImp.lo However, the SerialImp.lo is not present (which is the cause of the error, I think). On the other hand, the file I am looking for is present in: i686-pc-linux-gnu Possibly the i386 generation is not clean (of course it is also likely that I am just asking dumb questions, being a newbie to the code and all.). Finally, will this make file regenerate the distro for the mac? I found some really old (from year 2001) files in: cvs/MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions Which I could use for the distro...but I would prefer to do a clean, multi-platform build from make. Thanks! - Doug >On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > >> Hi All, >> I wrote: >> Jasmine: Is this working any better? >> >> And Jasmine says: >> Nope. >> >> An error occurred while launching/running the application. >> >> Title: addbk.JAddressBook.Main >> Vendor: DocJava, Inc. >> Category: Unexpected Error >> >> gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) >> >> > > I am using -source 1.3 and -target 1.3 >> for the compilation, however, we still seem to have this problem, >> which my machine (for some reason) does not have. >> Does anyone have any ideas about what might be the problem? >> > >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. > > >The suggested -source/target fix should avoid the problem. > >-- >Trent Jarvi >tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 28 09:43:41 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 28 Jun 2005 10:43:41 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: <42C1702D.1070307@atcorp.com> > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. There is ioctl stuff in the driver for the chip, but i haven't seen the TIOC*SERIAL entries. That might be why it continues to fail. I did get around the problem, though, by hacking the driver and just specifying the baud rate I need. Now everything works well. Thanks for all the assistance you've provided. ~ Shawn M. Lavelle From taj at www.linux.org.uk Tue Jun 28 12:42:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:42:29 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known Add a compiler flag -DWIN32 The code above should not be compiling on w32 as it is #if !defined(WIN32) You can look at the bottom of Makefile.in to see the w32 compile flags. Search for "WIN32 CrossCompiling from here down" If its still not working, I can set you up with the Bob account. Just email me off the list. W32 compiling is a bit complicated. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 28 12:52:50 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:52:50 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Nods. I did change configure but right now it is only in the baudbase/divisor patch I posted. I'm going to add several extension baud rates that can be supported by normal API calls and commit that today as a followup to my comments yesterday on baudrates. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Wed Jun 29 01:52:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 08:52:10 +0100 (BST) Subject: [Rxtx] [PATCH] More baud rate fixes Message-ID: I went through the native baudrate conversion from Java and added several. This patch is against CVS 2.1 head. I think thats it for baud rate fixes unless someone see something. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- A non-text attachment was scrubbed... Name: baud_base_and_divisor_plus_odd_baudrates.diff.gz Type: application/x-gzip Size: 3291 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050629/4c1ef1c2/baud_base_and_divisor_plus_odd_baudrates.diff-0401.gz From lyon at docjava.com Wed Jun 29 10:33:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 29 Jun 2005 12:33:45 -0400 Subject: [Rxtx] java.comm dependencies Message-ID: Hi All, During a build of the rxtx code, I have left the javax.comm out of the system (on purpose). However, I get an error, at run time: CommPortIdentifier:static initialization() apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: javax/comm/CommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver I am thinking that there is something in the gnu.io.CommPortIdentifier that seeks to load the javax.comm.CommDriver. It was my understanding that we could write code without reference to the javax.comm.CommDriver and that we could work in the gnu namespace. Is this true? Thanks! - Doug From taj at www.linux.org.uk Wed Jun 29 11:16:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 18:16:08 +0100 (BST) Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > During a build of the rxtx code, I have left the > javax.comm out of the system (on purpose). > However, I get an error, at run time: > > CommPortIdentifier:static initialization() > apple.awt.EventQueueExceptionHandler Caught Throwable : > java.lang.NoClassDefFoundError: javax/comm/CommDriver > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > that seeks to load the javax.comm.CommDriver. > > It was my understanding that we could write code without reference > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > Is this true? > Yes. People use 2.1 without javax all the time. There should be no reference to javax at all in rxtx 2.1. You may check your code. I just did a grep through 2.1 and there is nothing. You may look at the classes you are using. If you find javax.comm in your code, replace it with gnu.io and that should be all you need to do. -- Trent Jarvi tjarvi at qbang.org From jayant28k at gmail.com Wed Jun 29 21:49:28 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Thu, 30 Jun 2005 09:19:28 +0530 Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: <6a6a02310506292049778c452f@mail.gmail.com> Trent, I think best idea is to have wiki for rxtx code. So as the traffic is increasing with time. "RXTX" seems to be more popular in embbeded system. Sun Microsystems will always apperciate your efforts on parallel and serial ports commincation based application in IT Industry. Thanks for your help on this forum as "ONE MAN ARMY" ;-) Cheers, Jayant On 6/29/05, Trent Jarvi wrote: > On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > > > Hi All, > > During a build of the rxtx code, I have left the > > javax.comm out of the system (on purpose). > > However, I get an error, at run time: > > > > CommPortIdentifier:static initialization() > > apple.awt.EventQueueExceptionHandler Caught Throwable : > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > > that seeks to load the javax.comm.CommDriver. > > > > It was my understanding that we could write code without reference > > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > > > Is this true? > > > > Yes. People use 2.1 without javax all the time. > > There should be no reference to javax at all in rxtx 2.1. You may check > your code. I just did a grep through 2.1 and there is nothing. You may > look at the classes you are using. > > If you find javax.comm in your code, replace it with gnu.io and that > should be all you need to do. > > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From uwe at kubosch.no Sat Jun 25 02:50:24 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Sat, 25 Jun 2005 10:50:24 +0200 Subject: [Rxtx] RXTX in FC3/FC4 Message-ID: <1119689424.12606.14.camel@BPC0276> Hi all! I am trying to get RXTX to work on Fedora Core, version 3 or 4. I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext directory. I have edited the jre/lib/javax.comm.properties according to the docs. I have tried this with both rxtx 2.0 and 2.1. I have tried on two different machines. I have tried with java 1.4.2 and java 1.5.0, both from Sun. I always get a signall 11 from the native libraries when they are loaded. Is this a common problem? Any help is greatly appreciated. Below is the start of the error message. More can be supplied on demand. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x65015A Function=(null)+0x65015A Library=/lib/ld-linux.so.2 NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) - locked <0xed46f628> (a java.util.Vector) - locked <0xed471708> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xed46ebc0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.InitializeDriver(CommPortIdentifier.java:213) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:248) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:351) at com.jpeterson.x10.module.CM11A.allocate(CM11A.java:1160) at net.sourceforge.cruisecontrol.publishers.X10Publisher.send(X10Publisher.java:182) at net.sourceforge.cruisecontrol.publishers.X10Publisher.turnOff(X10Publisher.java:171) at net.sourceforge.cruisecontrol.publishers.X10Publisher.handleBuild(X10Publisher.java:148) at net.sourceforge.cruisecontrol.publishers.X10Publisher.publish(X10Publisher.java:141) at net.sourceforge.cruisecontrol.Project.publish(Project.java:679) at net.sourceforge.cruisecontrol.Project.build(Project.java:227) at net.sourceforge.cruisecontrol.Project.execute(Project.java:153) at net.sourceforge.cruisecontrol.ProjectWrapper.run(ProjectWrapper.java:66) at java.lang.Thread.run(Thread.java:534) From chris_jh at blueyonder.co.uk Tue Jun 28 05:37:10 2005 From: chris_jh at blueyonder.co.uk (Christopher Harris) Date: Tue, 28 Jun 2005 12:37:10 +0100 Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError Message-ID: <42C13666.9030108@blueyonder.co.uk> Hi I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 32bit) The serial ports work fine with no issues, but when i try to use the parallel port i get this message Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:66) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) I am trying to print a line out to port "/dev/lp0" At first i thought it could not find the librxtxParallel.so file, but when i renamed it i got a different saying it could not find the library. I have tried to run as root no difference. It is really weird, i get no compile errors and the serial ports work fine. I changed the LPRPort.java and commented out the Initialize call method. And just get the same error but for the method open. It is as though it can't see the methods, and yet it can see the library. I did have a bit of check of the JNI implementation in rxtx but could not spot anything. Yours Thankfully Christopher Harris From lyon at docjava.com Thu Jun 30 02:28:09 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 04:28:09 -0400 Subject: [Rxtx] tools Message-ID: Hi All, I have been thinking about automatic cross-platform native method development of Java/C programs. It appears that different binary tools are needed to target different platforms. Configuration seems a bit painful. Is there something better available than make? Is ANT any good at this? Has anyone tried: http://jnipp.sourceforge.net/ Thanks! - Doug From lyon at docjava.com Thu Jun 30 04:11:17 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 06:11:17 -0400 Subject: [Rxtx] javax.comm Message-ID: Hi All, When I load my jar files on a linux box, all is well. However, when I load them on a mac, I get: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver The jar files for the mac are different from the jar files for linux, because recompilation of the native code for the mac has not been easy, for me. As a result, the RXTX jars are tending toward specific versions and platforms. Probably, this is not an ideal situation, but, I suspect, it is common. I have an idea that we could create a single JNLP distro site that we can make reference to that would enable a uniform repository of synchronized signed native methods and jars for RXTX. For example, the one-wire Maxim folks have a real-nice approach where their stuff makes reference to another JNLP file that contains all the stuff we need to make RXTX work. Check it out at: http://www.maxim-ic.com/products/ibutton/software/1wire/OneWireViewer.cfm However, even they have problems on an unconfigured machine: Specified adapter name "DS9097U" is not known * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cannot load default adapter. Please check that the adapter is connected and that no other application is using the port. If you have checked the adapter, the default port might not be selected. Either set the value of the TMEX default using the utility provided with the TMEX Runtime, or create a new file in the /lib folder called onewireviewer.properties with two lines, similar to the following: #native win32 drivers adapter.name={DS9097U} adapter.port=COM1 #or javax.comm drivers adapter.name=DS9097U adapter.port=COM1 The full path to this file should be: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/onewireviewer.properties ---- Wow, that is a show stopper! Configuration is something that we really need to think about as an automatic thing, particularly for web start users. You can't ask a person who wants to run an application to figure out how to alter a properties file. If you know you need one, then get permission and make one...automatically. That makes a lot of sense, to me. Basically, we need an installer. At the very least, all the pre-built binaries and jars needed for the RXTX package on several platforms should be available from a single place. One this happens, we can make a JNLP file that is platform specific, but can give us a level of indirection. Is this something that has been done already? Thanks! - Doug From taj at www.linux.org.uk Thu Jun 30 08:10:22 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 15:10:22 +0100 (BST) Subject: [Rxtx] tools In-Reply-To: References: Message-ID: On Thu, 30 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I have been thinking about automatic cross-platform > native method development of Java/C programs. > > It appears that different binary tools are needed to target different > platforms. Configuration seems a bit painful. > > Is there something better available than make? > > Is ANT any good at this? I'm far from an Ant expert but have used it for other projects. The main problem I see with ant is there is no mainstream support for platform neutral neutral library creation as far as I can tell. I think ant is a fine replacement for make but I've not seen a suitable replacement for autoconf. At that point, make is as good as anything. It should be possible to create a ant build.xml that works on say Solaris, Linux, Windows and Mac OS X. The problem is when you are trying to build a library for embeded ARM from Mac OS X. > Has anyone tried: > http://jnipp.sourceforge.net/ -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:22:02 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:22:02 +0100 (BST) Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <1119689424.12606.14.camel@BPC0276> References: <1119689424.12606.14.camel@BPC0276> Message-ID: On Sat, 25 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I am trying to get RXTX to work on Fedora Core, version 3 or 4. > > I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 > directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext > directory. > > I have edited the jre/lib/javax.comm.properties according to the docs. > > I have tried this with both rxtx 2.0 and 2.1. > > I have tried on two different machines. > > I have tried with java 1.4.2 and java 1.5.0, both from Sun. > > I always get a signall 11 from the native libraries when they are > loaded. Is this a common problem? Any help is greatly appreciated. > Below is the start of the error message. More can be supplied on > demand. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x65015A > Function=(null)+0x65015A > Library=/lib/ld-linux.so.2 > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) If you compile rxtx from source, this will probably go away. I'm not sure what the exact cause is but it looks like the binaries are not suitable for FC3/4. The ABI may have changed since those had been compiled. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:26:56 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:26:56 +0100 (BST) Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError In-Reply-To: <42C13666.9030108@blueyonder.co.uk> References: <42C13666.9030108@blueyonder.co.uk> Message-ID: tOn Tue, 28 Jun 2005, Christopher Harris wrote: > Hi > > I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 > 32bit) > > The serial ports work fine with no issues, but when i try to use the > parallel port i get this message > > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:66) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) > > > I am trying to print a line out to port "/dev/lp0" > > At first i thought it could not find the librxtxParallel.so file, but > when i renamed it i got a different saying it could not find the library. > > I have tried to run as root no difference. > > It is really weird, i get no compile errors and the serial ports work fine. > > I changed the LPRPort.java and commented out the Initialize call method. > And just get the same error but for the method open. > > It is as though it can't see the methods, and yet it can see the library. > I did have a bit of check of the JNI implementation in rxtx but could > not spot anything. > > > You can check if the symbols are in the shared library: nm librxtxSerial.so |grep Initialize If the symbols are not there, there was a build error. Watch very close for build errors while compiling from source. I suspect something isnt behaving right. -- Trent Jarvi tjarvi at qbang.org From allen at adbyrne.us Thu Jun 30 06:55:58 2005 From: allen at adbyrne.us (Allen Byrne) Date: Thu, 30 Jun 2005 07:55:58 -0500 Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> References: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> Message-ID: <200506300755.59159.allen@adbyrne.us> On Thursday 30 June 2005 00:31, rxtx-request at mail.electronpusher.org wrote: > >Message: 8 >Date: Sat, 25 Jun 2005 10:50:24 +0200 >From: Uwe Kubosch >Subject: [Rxtx] RXTX in FC3/FC4 >To: rxtx at mail.electronpusher.org >Message-ID: <1119689424.12606.14.camel at BPC0276> >Content-Type: text/plain > >Hi all! > >I am trying to get RXTX to work on Fedora Core, version 3 or 4. > >I have tried this with both rxtx 2.0 and 2.1. > >I have tried on two different machines. > >I have tried with java 1.4.2 and java 1.5.0, both from Sun. > >I always get a signall 11 from the native libraries when they are >loaded. ?Is this a common problem? ?Any help is greatly appreciated. >Below is the start of the error message. ?More can be supplied on >demand. > >An unexpected exception has been detected in native code outside the VM. >Unexpected Signal : 11 occurred at PC=0x65015A >Function=(null)+0x65015A >Library=/lib/ld-linux.so.2 > I had thi same problem on SUSE9.3 and java 1.5.0. After searching through the archives, I found a patch that required adding a sleep(1000) command in two functions of SerialIO.java. This only was for rxtx2.1, I had no trouble with rxtx2.0. Note, also I had to add the "|1.5*" sequence to the configure.in file to get good *.so libs. Again 2.0 was fine. -- Allen Byrne adbyrne at ieee.org http://modelrr.adbyrne.us From taj at www.linux.org.uk Fri Jun 3 01:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 08:57:29 +0100 (BST) Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 3 09:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 16:57:53 +0100 (BST) Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi at qbang.org From jasmine at electronpusher.org Fri Jun 3 10:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 17:12:21 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 11:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:02:09 +0100 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 11:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:05:10 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From jon.nall at gmail.com Mon Jun 6 09:13:58 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 10:13:58 -0500 Subject: [Rxtx] StackOverflowError Message-ID: I have a fairly small application that is communicating to a microcontroller programmer at 115.2k. I have a test where I try and dump the memory of the microcontroller (whose size is 8k and change). Things are going smoothly and the data looks good. Then after reading out ~6.5k of data, I get a StackOverflowError. The stack trace looks like: CommInterface.serialEvent(): 324 // this is my code RXTXPort.sendEvent(): 732 RXTXPort.eventLoop() [Native] MonitorThread.run(): 1531 I am running on windows and using rxtx-2.1-CVS-20050120. When I increased the stack size to 512k, I could read the entire chip without issue. But that doesn't seem like the right thing to do without root causing what's happening. My code doesn't include any recursion and the stack trace looks terribly short, so I'm a bit confused as to why I'm getting a StackOverflowError. CommInterface.serialEvent() does little more than grab the available bytes, enter a synchronized block, stick them in a common data area for the main thread to use and leave the synchronization block. I guess my question is: are there any known issues with the default stack size when using the latest rxtx on windows? thanks, nall. From taj at www.linux.org.uk Mon Jun 6 09:27:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 16:27:34 +0100 (BST) Subject: [Rxtx] StackOverflowError In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > I have a fairly small application that is communicating to a > microcontroller programmer at 115.2k. I have a test where I try and > dump the memory of the microcontroller (whose size is 8k and change). > Things are going smoothly and the data looks good. Then after reading > out ~6.5k of data, I get a StackOverflowError. The stack trace looks > like: > > CommInterface.serialEvent(): 324 // this is my code > RXTXPort.sendEvent(): 732 > RXTXPort.eventLoop() [Native] > MonitorThread.run(): 1531 > > I am running on windows and using rxtx-2.1-CVS-20050120. When I > increased the stack size to 512k, I could read the entire chip without > issue. But that doesn't seem like the right thing to do without root > causing what's happening. My code doesn't include any recursion and > the stack trace looks terribly short, so I'm a bit confused as to why > I'm getting a StackOverflowError. > > CommInterface.serialEvent() does little more than grab the available > bytes, enter a synchronized block, stick them in a common data area > for the main thread to use and leave the synchronization block. > > I guess my question is: are there any known issues with the default > stack size when using the latest rxtx on windows? > This is the first I've heard of the problem. It is strange as you mention lookin at the stack trace. That cant be taking up too much space. If you just toss the data instead of trying to put it in your work area, does it persist? -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Mon Jun 6 10:09:39 2005 From: lengyel at gmail.com (FL) Date: Mon, 6 Jun 2005 12:09:39 -0400 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on which the jdk1.5.0_03 is installed. I found that the INSTALL documentation seems to be in error. It states that javacomm20-x86.tar.Z (the Java Communications API for Solaris/x86) must be used, in fact this choice led to the following test with theBlackBox sample program in the commapi: root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG BlackBox -p /dev/ttyS0 Port /dev/ttyS0 not found! No serial ports found! Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to cause Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to the Eclipse stable build version 3.1M7 to avoid this. However, I found that using the Solaris/Sparc version of commapi worked on my system. I have documented this on: http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050606/b28fb9a7/attachment-0402.html From taj at www.linux.org.uk Mon Jun 6 10:30:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:30:27 +0100 (BST) Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, FL wrote: > I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on > which the jdk1.5.0_03 is installed. I found that the INSTALL documentation > seems to be in error. It states that javacomm20-x86.tar.Z (the Java > Communications API for Solaris/x86) must be used, in fact this choice led to > the following test with theBlackBox sample program in the commapi: > > root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG > BlackBox -p /dev/ttyS0 > Port /dev/ttyS0 not found! > No serial ports found! > > Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to > cause > Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to > the Eclipse stable build version 3.1M7 to avoid this. > > However, I found that using the Solaris/Sparc version of commapi > worked on my system. > > I have documented this on: > > http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 > Thanks FL. I'll change the documentation to point to the SPARC comm.jar. In the past, any Solaris was good enough, we tried to avoid the w32 comm.jar because it made native calls rxtx would never implement on any OS as they are not platform neutral. I'll withold comments about Sun's comm.jar being different on various CPUs within even the same OS. RXTX 2.1 does not need to do that even acrossed OSs for instance. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 6 10:35:43 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 11:35:43 -0500 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API Message-ID: It seems that Sun's javax.comm site does not include JavaDoc'ed API and the RxTx site has the API, but no real documentation. Is there some site that i'm just missing in my google searches? I'm looking for a copy of the javax.comm API which is documented. Thanks, nall. From taj at www.linux.org.uk Mon Jun 6 10:44:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:44:03 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > It seems that Sun's javax.comm site does not include JavaDoc'ed API > and the RxTx site has the API, but no real documentation. Is there > some site that i'm just missing in my google searches? I'm looking for > a copy of the javax.comm API which is documented. > > Thanks, > nall. Sun's version is with their binary downloads. RXTX tries to match that so I never bothered with more complete JavaDocs. Whatever Sun documents is what we try to do. -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Mon Jun 6 12:13:44 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 6 Jun 2005 14:13:44 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: Message-ID: <20050606181245.528C929D56F@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Trent Jarvi > Sent: Monday, June 06, 2005 12:44 PM > To: Jon Nall; Java RXTX discussion > Subject: Re: [Rxtx] Where can I find JavaDoc on the javax.comm API > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > It seems that Sun's javax.comm site does not include JavaDoc'ed API > > and the RxTx site has the API, but no real documentation. Is there > > some site that i'm just missing in my google searches? I'm > looking for > > a copy of the javax.comm API which is documented. > > > > Thanks, > > nall. > > Sun's version is with their binary downloads. RXTX tries to > match that so I never bothered with more complete JavaDocs. > Whatever Sun documents is what we try to do. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Try http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht ml -Ack From gadelavega at yahoo.com.ar Mon Jun 6 12:58:09 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Mon, 6 Jun 2005 15:58:09 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606181245.528C929D56F@mail.electronpusher.org> Message-ID: <20050606185809.57069.qmail@web14603.mail.yahoo.com> --- "David S. Acker" escribi?: > > -----Original Message----- > > From: rxtx-bounces at mail.electronpusher.org > > [mailto:rxtx-bounces at mail.electronpusher.org] On > Behalf Of Trent Jarvi > > Sent: Monday, June 06, 2005 12:44 PM > > To: Jon Nall; Java RXTX discussion > > Subject: Re: [Rxtx] Where can I find JavaDoc on > the javax.comm API > > > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > > > It seems that Sun's javax.comm site does not > include JavaDoc'ed API > > > and the RxTx site has the API, but no real > documentation. Is there > > > some site that i'm just missing in my google > searches? I'm > > looking for > > > a copy of the javax.comm API which is > documented. > > > > > > Thanks, > > > nall. > > > > Sun's version is with their binary downloads. > RXTX tries to > > match that so I never bothered with more complete > JavaDocs. > > Whatever Sun documents is what we try to do. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > Try > http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > ml > -Ack > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > I'm prety sure it was there... but not anymore. Gonzalo A. de la Vega, BI ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From taj at www.linux.org.uk Mon Jun 6 18:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 01:09:14 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606185809.57069.qmail@web14603.mail.yahoo.com> References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: >> http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > > I'm prety sure it was there... but not anymore. > It is there. Maybe the URL got mangled. Try this http://tinyurl.com/8dfp7 It just redirects you to: http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.html -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 7 05:46:39 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Jun 2005 07:46:39 -0400 Subject: [Rxtx] rxtx under fedora - odd procedures Message-ID: Hi All, I was able to get RXTX communications to work under Fedora, but only after I added myself to the UUCP and LOCK groups, logged out and then logged back in. Both groups appear to be needed in order to access the serial ports. Also the group alter did not take until after I logged out and logged back in. My theory is that you need permission to write to the var/spool directory under fedora and that this is the only way to do it. Logging out and logging back in just seems like an odd thing to do. I suppose some users may have to restart X. Ouch! Is this true? The alter_group command indicates that you need to be an su to alter the group database. Does this mean that my serial port users need a database su able person to use serial port applications under RXTX? If so, what is the procedure to make a transparent install work using Java web start? Should I be prompting users for the su password? Should I be telling users to exit from X and log out? Is this the way other serial communications programs work? Thanks! - Doug From sean_montgomery at baseview.com Tue Jun 7 08:14:51 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 7 Jun 2005 10:14:51 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: >>> http://java.sun.com/products/javacomm/javadocs/javax/comm/package- >>> summary.ht >>> > > >> >> I'm prety sure it was there... but not anymore. >> >> > > It is there. Maybe the URL got mangled. Try this > > http://tinyurl.com/8dfp7 > > It just redirects you to: > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > summary.html > Maybe the issue here is that the info is available without frames from that URL, but when you try to access it with frames (from the link on that page) it doesn't work - it takes you to: http://java.sun.com/products/javacomm/javadocs/index.html Which doesn't have anything useful on it. From gadelavega at yahoo.com.ar Tue Jun 7 08:22:50 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:22:50 -0300 (ART) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: Message-ID: <20050607142251.92850.qmail@web14626.mail.yahoo.com> --- "Dr. Douglas Lyon" escribi?: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the > group > alter did not take until after I logged out and > logged back in. > > My theory is that you need permission to write to > the var/spool > directory under fedora and that this is the only way > to do it. > > Logging out and logging back in just seems like an > odd thing to > do. I suppose some users may have to restart X. > Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port > applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log > out? > Is this the way other serial communications programs > work? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Actually, you need the lock group to acces /var/lock directory, and uucp to acces /dev/ttyS*. You (as root) shuold add all users you will allow to use the serial ports to group uucp and all the ones you'll allow to lock the ports to lock group (rxtx needs both). This is not only for rxtx, but for any use of the serial ports. Next time they login they'll be able to work, so if they are in they'll have to log out first. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From gadelavega at yahoo.com.ar Tue Jun 7 08:23:56 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:23:56 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> Message-ID: <20050607142356.93815.qmail@web14624.mail.yahoo.com> --- Sean Montgomery escribi?: > > On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: > > >>> > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > >>> summary.ht > >>> > > > > > >> > >> I'm prety sure it was there... but not anymore. > >> > >> > > > > It is there. Maybe the URL got mangled. Try this > > > > http://tinyurl.com/8dfp7 > > > > It just redirects you to: > > > > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > > summary.html > > > > Maybe the issue here is that the info is available > without frames > from that URL, but when you try to access it with > frames (from the > link on that page) it doesn't work - it takes you > to: > > http://java.sun.com/products/javacomm/javadocs/index.html > > Which doesn't have anything useful on it. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > That's right, my bad. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From jon.nall at gmail.com Tue Jun 7 08:33:40 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 09:33:40 -0500 Subject: [Rxtx] performance expectations Message-ID: Hi all. I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC microcontroller. The protocol I'm using (which I didn't create) looks like this for the section of code I'm concerned with: PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data PIC -> PC: 0x01 // ACK 0xNN // First 8 bits of data 0xMM // Second 8 bits of data I issue ~2000 of these Read commands. The PIC itself has an input fifo which can store 18 bytes, so I can have 18 read commands in flight at a given time. The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k 8N1. I am measuring the time it takes to perform these 2000 commands at around 30 seconds, which is much longer than I anticipated. With the link fully utilized, I expected: Time per byte transmitted: 115200 / 8 = 14400 bytes/second = ~70 uS/byte Time per response transmitted: ~70 uS/byte * 3 bytes/response = ~210 uS/response Time for 2000 responses to be transmitted: ~210 uS/response * 2000 responses = ~420ms I'm a bit new to this, so I may have made some bad asumptions, but I would have expected a time of a couple of seconds to perform the 2000 reads, not 30+ seconds. I'm obviously missing something here. Can someone help me understand what's going on? Thanks, nall. From taj at www.linux.org.uk Tue Jun 7 09:17:48 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:17:48 +0100 (BST) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the group > alter did not take until after I logged out and logged back in. > > My theory is that you need permission to write to the var/spool > directory under fedora and that this is the only way to do it. > > Logging out and logging back in just seems like an odd thing to > do. I suppose some users may have to restart X. Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log out? > Is this the way other serial communications programs work? > RIght now, rxtx requires you do one of two things. 1) Use lock files (recommended). This requires intervention by the root users to allow users to create lock files and open the ports as you note. 2) configure rxtx with --disable-lockfiles. In this case you need only worry about the permissions on /dev/ttyS* I'm not sure what the default on Fedora is with respect to permisions. This is not very attractive. There is a better way it could be done on Fedora. Fedora comes with lockdev library. I've been considering this for some time. We could use that for the locking and do away with many of the problems. The problem is embeded devices running Linux do not come with liblockdev. But for your use, I would consider adding a new option for locking serial devices using liblockdev. lockdev-devel has a man page with further information. SYNOPSIS #include pid_t dev_testlock( const char * devname); pid_t dev_lock( const char * devname); pid_t dev_relock( const char * devname, pid_t pid); pid_t dev_unlock( const char * devname, pid_t pid); cc [ flag ... ] file ... -llockdev [ library ] This would probably need to be a configure time option to prevent problems on embeded Linux devices but could otherwise be the default on Linux. I could toss a quick patch together if this is confusing. It is actually easier than what rxtx does now. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 09:27:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:27:11 +0100 (BST) Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > Hi all. > I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC > microcontroller. The protocol I'm using (which I didn't create) looks like this > for the section of code I'm concerned with: > > PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data > PIC -> PC: 0x01 // ACK > 0xNN // First 8 bits of data > 0xMM // Second 8 bits of data > > I issue ~2000 of these Read commands. The PIC itself has an input fifo which > can store 18 bytes, so I can have 18 read commands in flight at a given time. > The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k > 8N1. > > I am measuring the time it takes to perform these 2000 commands at around 30 > seconds, which is much longer than I anticipated. With the link fully utilized, > I expected: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte > > Time per response transmitted: > ~70 uS/byte * 3 bytes/response = ~210 uS/response > > Time for 2000 responses to be transmitted: > ~210 uS/response * 2000 responses = ~420ms > > I'm a bit new to this, so I may have made some bad asumptions, but I would have > expected a time of a couple of seconds to perform the 2000 reads, not 30+ > seconds. > > I'm obviously missing something here. Can someone help me understand what's > going on? > I've hooked rxtx in loopback with a scope in the past at 9600 baud (baud rate is not important). Using event notification and just writing a byte on event/read the latencey was around 8-12 ms. The JNI is not an efficient way to use native code - especially for bit banging. So if timing is critical you want to move some of the logic into the native code rather than banging over the JNI. 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your performance. C# has advantages here. If you move your logic into the native layer or use gcj (rxtx will work with that too) most of your latency should vanish. You may have to play with some sleeps in eventLoop at that point to get full native efficiency. With gcj all of rxtx becomes 'native code' as java is just treated as a subset of C++. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 09:38:51 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 10:38:51 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: On 6/7/05, Jon Nall wrote: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte of course that should be divided by 10 to account for the start/stop bits, but it barely changes the end results. From carobizar at free.fr Tue Jun 7 10:21:29 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 7 Jun 2005 18:21:29 +0200 Subject: [Rxtx] (no subject) Message-ID: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Hello ! I am a french student and I have to create an application able to read and write on serial and parallel port and to run on Windows and Linux. For the moment my program run on Windows thanks the Java Communication API (version for Microsoft Windows and Solaris/x86). But it doesn't work on Linux. Does a recent version of an installation documentation exist ? I didn't find one on the RXTX site (nothing for the windows installation and the linux installation deals with a "jcl.jar" that I don't know...). So, I have some questions : 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 version or Linux&w32 version ?) What are the differences between them ? Which of them are the most stable ? 2) Where have I to put the .so and .dll files ? 3) What have I to write on the file javax.comm.properties ? 4) Have I to delete the file win32comm.dll included in the Java Comm API ? 5) Have I to keep both comm.jar and RXTXcomm.jar ? Best regards, Caroline. From debief at telemsa.com Tue Jun 7 10:44:56 2005 From: debief at telemsa.com (DEBIEF Eric) Date: Tue, 7 Jun 2005 18:44:56 +0200 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: <200506071844.56656.debief@telemsa.com> Hi, We are "pushing" RxTx /Java here in a half-duplex link. The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC and application handling) about 25?s/byte. The figures are the barely the same on two environments. Environment 1 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Linux 2.6.3, Mdk 10.0. RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : bytes are lost on the wire. I need to investigate this mystery.... Java : 1.4.2-rc1 Blackdown Environment 2 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Windows 2000 Pro RxTx : 2.0.7. Java : 1.4.2_08 SUN I Hope this help, Eric. _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 7 11:05:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:05:45 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, DEBIEF Eric wrote: > Hi, > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. How many write() calls is this? > > Environment 1 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Linux 2.6.3, Mdk 10.0. > RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : > bytes are lost on the wire. I need to investigate this mystery.... > Java : 1.4.2-rc1 Blackdown > > Environment 2 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Windows 2000 Pro > RxTx : 2.0.7. > Java : 1.4.2_08 SUN > In my event/read/write test I found windows was ~20% faster than linux for some reason (strange part is Windows was in VMWare on the same Linux machine). It was about the same rxtx version. There are many problems with rxtx 1.4 with respect to commapi on windows but its code paths are more simple. What some people want from rxtx is perhaps better served by hacking up the very first release as they just want to read and write which is what rxtx was before Sun released commapi. It sounds like perhaps you are pushing out larger writes which will greatly improve results. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 11:16:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:16:49 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118161289.42a5c989cf6a2@imp4-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: On Tue, 7 Jun 2005 carobizar at free.fr wrote: > > Hello ! > > I am a french student and I have to create an application able to read and write > on serial and parallel port and to run on Windows and Linux. > For the moment my program run on Windows thanks the Java Communication API > (version for Microsoft Windows and Solaris/x86). > But it doesn't work on Linux. > > Does a recent version of an installation documentation exist ? > I didn't find one on the RXTX site (nothing for the windows installation and the > linux installation deals with a "jcl.jar" that I don't know...). > > So, I have some questions : > > 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 > version or Linux&w32 version ?) What are the differences between them ? Which > of them are the most stable ? > Use rxtx 2.0 with commapi for sparc solaris from Sun. If you want your current package javax.comm. > 2) Where have I to put the .so and .dll files ? On Linux just use the source, the configure script will do all of that for you. tar -xzvf rxtx-2.0-version mkdir rxtx-2.0-version/build cd rxtx-2.0-version/build ../configure && make install It will do everything for you. With Windows, you need to create the javax.comm.properties and install the DLL on your path. But you can just use Sun's package too. They are intended to be interchangable. > > 3) What have I to write on the file javax.comm.properties ? Driver=gnu.io.RXTXCommDriver More documentation in INSTALL that comes with the source. Sun's documentation should work too. configure does this for you on Linux. > > 4) Have I to delete the file win32comm.dll included in the Java Comm API ? > No > 5) Have I to keep both comm.jar and RXTXcomm.jar ? > Yes. RXTX 2.1 replaces comm.jar but the package is different (gnu.io) to avoid contaminating Sun's namespace. With rxtx 2.0 you need Sun's comm.jar - they work together. > > Best regards, > Caroline. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Tue Jun 7 12:07:34 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 14:07:34 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 Message-ID: <20050607180632.1543A29D5C8@mail.electronpusher.org> Hello, I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our product includes a built in USB to Serial adapter so that when it is connected to your PC over USB, it appears as a serial port. We had problems with Sun's comm library because it did not detect serial ports coming and going properly. I did run into a few issues with RxTx though. I am building under Windows (we support XP and 2000) under cygwin. I used a simple make file for the c code that works under cygwin and ant to build the java stuff. Attached is a diff file. The patches hit the following issues: ParallelImp.c - I am not using config so there is no config.h for me. Also, gcc didn't like a local file (win32termios.h) getting included with <> . RXTXPort.java - You can get an exception during the writeByte, writeArray, nativeDrain, readByte, read, readArray, readTerminatedArray, and nativeAvailable calls. Without this patch the IOLocked count gets stuck incremented. termios.c - If you try to open a port through CreateFile and get ERROR_ACCESS_DENIED it means someone else is using the port. We need to make sure to use serial_close instead of just close. I found that some devices finish their I/O synchronously. The code was treating this as an error. I also added some checking on the ClearError calls. I found a compile error when debugging is turned on (see the usleep change). SerialImp.c - Again, I don't have a config.h and again we must use quotes and not <> to include win32termios.h . I also commented out a report call since it seems to happen constantly on my system. Feel free to use these in any way that you want or just to ignore them. Thanks! -Dave Acker dacker at nomadio.net Software Engineer Nomadio, Inc. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diffs.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/5671d159/diffs-0399.txt From jon.nall at gmail.com Tue Jun 7 12:28:16 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 13:28:16 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, DEBIEF Eric wrote: > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. Hi. This is helpful, thanks. I can think of 2 reasons I'm not collecting the data as fast as I think I should be: 1) the device to PC connection is not at 100% utilization 2) my SerialPortEventListener processing has too much overhead Are there other explanations I might be missing as to why it takes so long to transfer the data? Thanks. nall. From taj at www.linux.org.uk Tue Jun 7 13:21:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:21:46 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > On 6/7/05, DEBIEF Eric wrote: > > We are "pushing" RxTx /Java here in a half-duplex link. > > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > > and application handling) about 25?s/byte. > > The figures are the barely the same on two environments. > > Hi. > This is helpful, thanks. I can think of 2 reasons I'm not collecting > the data as fast as I think I should be: > 1) the device to PC connection is not at 100% utilization > 2) my SerialPortEventListener processing has too much overhead > > Are there other explanations I might be missing as to why it takes so > long to transfer the data? > Polling the port would probably make more sense. You can set the threshold/timeouts to avoid racing and not deal with the event notification. As mentioned earlier I think the event latency is ~10ms. Keep the event listener around, rxtx 2.* does not close well without it. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 13:27:27 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 14:27:27 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, Trent Jarvi wrote: > Polling the port would probably make more sense. You can set the > threshold/timeouts to avoid racing and not deal with the event > notification. As mentioned earlier I think the event latency is ~10ms. Trent, Thanks for the response. Just to make sure I understand what you're talking about, when you say event latency, do you mean the time it takes from when the byte hits the PC's comm port to when rxtx presents it to user code? So if the link is 100% utilized, will my user code see "hiccups" or a steady stream of data? Thanks for helping a serial port newbie. nall. From dacker at nomadio.net Tue Jun 7 13:32:20 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 15:32:20 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <20050607193118.5499329CAA0@mail.electronpusher.org> Some folks asked about the make file and ant steps. I have JAVA_HOME set as follows: $ echo $JAVA_HOME C:\Program Files\Java\jdk1.5.0_01 I have all the code in rxtx/src put into gnu/io . The make file here doesn't have optimizations turned on. We have not tested with it yet. --------------Begin Makefile------------------ CPPFLAGS="-I$(JAVA_HOME)/include" "-I$(JAVA_HOME)/include/win32" SOBJECTS=SerialImp.o fuserImp.o termios.o fixup.o init.o POBJECTS=ParallelImp.o termios.o init.o DLLS=rxtxParallel.dll rxtxSerial.dll all: $(CLASSES) $(DLLS) rxtxSerial.dll: $(SOBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(SOBJECTS) rxtxParallel.dll: $(POBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(POBJECTS) clean: rm -fv $(SOBJECTS) $(POBJECTS) $(DLLS) %.o: %.c gcc -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< %.o: %.cpp g++ -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< --------------End Makefile------------------ Here is the ant target I use to build the rxtx libs. Our build puts the class files in a bin dir. We copy the dlls to a deploy dir and to the build dir. Eclipse seems to like the dlls in the build dir. The deploy dir is used when we build our full package. --------------Begin Ant Section------------------ --------------End Ant Section------------------ > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > David S. Acker > Sent: Tuesday, June 07, 2005 2:08 PM > To: 'Java RXTX discussion' > Subject: [Rxtx] Patches to 2.1-7pre17 > > Hello, > I am using RxTx with the Nomadio Sensor, > http://www.nomadio.net/ . Our product includes a built in > USB to Serial adapter so that when it is connected to your PC > over USB, it appears as a serial port. We had problems with > Sun's comm library because it did not detect serial ports > coming and going properly. > > I did run into a few issues with RxTx though. I am building > under Windows (we support XP and 2000) under cygwin. I used > a simple make file for the c code that works under cygwin and > ant to build the java stuff. Attached is a diff file. The > patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h > for me. Also, gcc didn't like a local file (win32termios.h) > getting included with <> . > > RXTXPort.java - You can get an exception during the > writeByte, writeArray, nativeDrain, readByte, read, > readArray, readTerminatedArray, and nativeAvailable calls. > Without this patch the IOLocked count gets stuck incremented. > > termios.c - If you try to open a port through CreateFile and > get ERROR_ACCESS_DENIED it means someone else is using the > port. We need to make sure to use serial_close instead of > just close. I found that some devices finish their I/O > synchronously. The code was treating this as an error. I > also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we > must use quotes and not <> to include win32termios.h . I > also commented out a report call since it seems to happen > constantly on my system. > > Feel free to use these in any way that you want or just to > ignore them. > Thanks! > > -Dave Acker > dacker at nomadio.net > Software Engineer > Nomadio, Inc. > From taj at www.linux.org.uk Tue Jun 7 13:37:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:37:45 +0100 (BST) Subject: [Rxtx] Re: Stack Smashing Attack In-Reply-To: <200506072012.48860.ferdinand.tatzig@web.de> References: <200506072012.48860.ferdinand.tatzig@web.de> Message-ID: On Tue, 7 Jun 2005, Ferdinand Tatzig wrote: > Dear Trent > > I am using RXTX for serial port communication between a PC and a payment > transaction terminal. > When I run my application under Windows 2000, an i386-Linux or an i386-FreeBSD > it works as I expect it to do. However, when I start it to run on AMD64 > machine with a 64-bit Gentoo Linux, the VM terminates with the following > error: > > Port found: /dev/ttyS0 > java: stack smashing attack in function configure_port() > > I am using a 64-bit Blackdown-1.4.2-01 VM. > > I have searched the internet but have found no information about this error. > > This is the code of the method which initializes the serial port: > > /** > * initializes a serial port for communication with a terminal; only > * accessible within this class > * > * @param communication > * @param serialPortToBeInitialized > * @param tillInterfaceEventListener > */ > private TillInterfaceSerialPort(Communication communication, > String serialPortToBeInitialized, > TillInterfaceEventListener tillInterfaceEventListener) > throws IOException, PortInUseException, > TillInterfaceSerialPortNotFoundException, > TooManyListenersException, UnsupportedCommOperationException { > serialPortName = "not initialized yet"; > CommPortIdentifier portId = null; > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > boolean portFound = false; > String temporarySerialPortName = "not initialized yet"; > > // look for a serial port > while (portList.hasMoreElements() && !portFound) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > temporarySerialPortName = portId.getName(); > if (temporarySerialPortName.equals(serialPortToBeInitialized)) { > System.out.print("Port found: "); > System.out.println(temporarySerialPortName); > serialPortName = temporarySerialPortName; > portFound = true; > } > } > } > if (portFound) { > > // initialize the found port - this command causes the VM to terminate > serialPort = (SerialPort) portId > .open( > TillInterfaceConstants.APPLICATION_NAME, > TillInterfaceConstants > .TIMEOUT_IN_MILLISECONDS_FOR_OPENING_OF_COMMUNICATION_PORT); > > // add an event listener which listens > // on the serial port and notifies the > // serial port object when input bytes > // have been received at the port > serialPort.addEventListener(tillInterfaceEventListener); > serialPort.notifyOnDataAvailable(true); > > // initialize the physical layer > // parameters of the serial port > serialPort.setSerialPortParams(TillInterfaceConstants.BAUD_RATE, > SerialPort.DATABITS_8, SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > // set the inter-character > // timeout (T2) > serialPort > .enableReceiveTimeout(TillInterfaceConstants.INTERCHARACTER_TIMEOUT_IN_MILLISECONDS); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > } else > throw new TillInterfaceSerialPortNotFoundException(); > } > > Any hint to solve this problem would be kindly appreciated. > The only thing that comes to mind here after looking at the offending function is rxtx used to include asm/termios.h but now we moved to termios.h and had glibc fix their headers. The asm/termios.h caused problems as its termios was smaller than the actual termios. This should be fixed in current rxtx versions but you can just glance at SerialImp.c and make sure it does not include asm/termios.h. I've cc'd the rxtx mail list because there was one other mention of stack problems recently. I have used rxtx on opteron systems with success. I have a bug I'm trying hard to reproduce on suse 64 bit (circa linux 2.4.19) systems though. So far I have not been able to reproduce the bug. That said, with gentoo... I like gentoo but I seriously doubt they do any QA with their kernel and Java. I've seen problems before. If you use gentoo and have Java problems, at least stick to Linus (that is an s there) kernels while using Java. I'm not an expert on gentoo but I've seen patches go into experimental kernels that turn out to break java and are reverted before going to Linus just before I see problems with gentoo on this list. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:16:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:16:14 +0100 (BST) Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: On Tue, 7 Jun 2005, David S. Acker wrote: > Hello, > I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our > product includes a built in USB to Serial adapter so that when it is > connected to your PC over USB, it appears as a serial port. We had problems > with Sun's comm library because it did not detect serial ports coming and > going properly. > > I did run into a few issues with RxTx though. I am building under Windows > (we support XP and 2000) under cygwin. I used a simple make file for the c > code that works under cygwin and ant to build the java stuff. Attached is a > diff file. The patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h for me. Also, > gcc didn't like a local file (win32termios.h) getting included with <> . > > RXTXPort.java - You can get an exception during the writeByte, writeArray, > nativeDrain, readByte, read, readArray, readTerminatedArray, and > nativeAvailable calls. Without this patch the IOLocked count gets stuck > incremented. > > termios.c - If you try to open a port through CreateFile and get > ERROR_ACCESS_DENIED it means someone else is using the port. We need to > make sure to use serial_close instead of just close. I found that some > devices finish their I/O synchronously. The code was treating this as an > error. I also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we must use quotes > and not <> to include win32termios.h . I also commented out a report call > since it seems to happen constantly on my system. > > Feel free to use these in any way that you want or just to ignore them. > Thanks! > Hi Dave These patches look great as is. Thanks. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:33:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:33:16 +0100 (BST) Subject: [Rxtx] Patch to IOLocked (fwd) Message-ID: This appears to be another solution to the locking. Chris, the other option just moves the locking into the finally clause which I think would be a little cleaner though I'm posting this patch to so people can comment. -- Trent Jarvi tjarvi at qbang.org ---------- Forwarded message ---------- Date: Wed, 1 Jun 2005 13:01:32 +0100 From: Christopher Dawes To: taj at www.linux.org.uk Subject: Patch to IOLocked Do you want me to check it out of CVS and then submit changes? Christopher -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXPort.java.diff Type: application/octet-stream Size: 6965 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/c442f9fc/RXTXPort.java-0402.obj From Christopher.Dawes at retail-logic.com Wed Jun 8 00:57:24 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 8 Jun 2005 07:57:24 +0100 Subject: [Rxtx] Patch to IOLocked (fwd) [Virus Checked] In-Reply-To: Message-ID: Agreed, much better Java :-) Thanks Christopher ------------------------------------------- Consultant Engineer Retail Logic Limited Fleet GU51 3TZ Tel: +44 (0)1252 644377 Mob: +44 (0)7899 842759 Fax: +44 (0)1252 776708 rxtx-bounces at mail.electronpusher.org wrote on 07/06/2005 21:33:16: > > This appears to be another solution to the locking. Chris, the other > option just moves the locking into the finally clause which I think would > be a little cleaner though I'm posting this patch to so people can > comment. > > -- > Trent Jarvi > tjarvi at qbang.org > > ---------- Forwarded message ---------- > Date: Wed, 1 Jun 2005 13:01:32 +0100 > From: Christopher Dawes > To: taj at www.linux.org.uk > Subject: Patch to IOLocked > > Do you want me to check it out of CVS and then submit changes? > > Christopher[attachment "RXTXPort.java.diff" deleted by Chris > Dawes/Retaillogic/NISABA] _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx From zempftman at gmail.com Wed Jun 8 07:57:25 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 09:57:25 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Maxwell Zempftman Date: May 27, 2005 5:01 PM Subject: Re: [Rxtx] Kaffe & rxtx & armv5b To: rxtx at mail.linuxgrrls.org Here are the results from working this week: The "NullPointerExceptions" are generated by the software when I choose a bad device file. I discovered that this occurs on the i686-RedHat box as well. This exception seems to be generated only by this particular application, and not by the example programs in contrib. So, for example: java MyApp /dev/null <-- generates NullPointerException java MyApp fake <-- generates NullPointerException java MyApp /dev/ttyS0 <-- does not generate NullPointerException Using the program CommCheck (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it appears as though /dev/ttyS0 is the only valid serial device file on the XScale device, so the errors I was getting are not really be bugs. Although /dev/ttyS0 did not generate NullPointerExceptions, I did encounter this error: --start java MyApp /dev/ttyS0 (going mostly from memory, not exact) PortList.hasMoreElements: true Listening on: /dev/ttyS0 Client connected. >From net: echo kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 vmExcept_setJNIFrame Assert: on 'fp != 0' failed. --end I took a look at exception.h, and it seems as though the problematic code does not exist in newer versions of Kaffe (I have been using CVS-2004-11). Next week I will try to use a newer version, although so far everything but CVS-2004-11 has failed. Also, I the device files I need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with something like this? Thanks, Max. > On 5/21/05, Trent Jarvi wrote: > > I'm not sure what is wrong in the first part. It sounds like your > > application may be swallowing an exception while trying to enumerate the > > port or open it. The usual mistake made it not having permissions to > > either open the port or create the lockfile. There should be examples in > > the contrib directory you can try that enumerate and open ports. Maybe > > that will give you some hints. > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > Sun's code limiting you there though you do need to compile and install > > rxtx for the XScale with Sun's Commapi. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > From taj at www.linux.org.uk Wed Jun 8 08:22:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 15:22:44 +0100 (BST) Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > ---------- Forwarded message ---------- > From: Maxwell Zempftman > Date: May 27, 2005 5:01 PM > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > To: rxtx at mail.linuxgrrls.org > > > Here are the results from working this week: > > The "NullPointerExceptions" are generated by the software when I > choose a bad device file. I discovered that this occurs on the > i686-RedHat box as well. This exception seems to be generated only by > this particular application, and not by the example programs in > contrib. So, for example: > > java MyApp /dev/null <-- generates NullPointerException > java MyApp fake <-- generates NullPointerException > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > Using the program CommCheck > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > appears as though /dev/ttyS0 is the only valid serial device file on > the XScale device, so the errors I was getting are not really be bugs. > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > encounter this error: > > --start > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > PortList.hasMoreElements: true > Listening on: /dev/ttyS0 > Client connected. > >From net: echo > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > --end > > I took a look at exception.h, and it seems as though the problematic > code does not exist in newer versions of Kaffe (I have been using > CVS-2004-11). Next week I will try to use a newer version, although so > far everything but CVS-2004-11 has failed. Also, I the device files I > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > something like this? > In RXTXCommDriver, just look for the following code and add /dev/ttyM to the list. Moxa? if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } So: if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyM", // for Moxa ports "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } Linux just has way too many port types to try enumerating them all. There is potential we can add them back in with udev now. > Thanks, > Max. > > > On 5/21/05, Trent Jarvi wrote: > > > I'm not sure what is wrong in the first part. It sounds like your > > > application may be swallowing an exception while trying to enumerate the > > > port or open it. The usual mistake made it not having permissions to > > > either open the port or create the lockfile. There should be examples in > > > the contrib directory you can try that enumerate and open ports. Maybe > > > that will give you some hints. > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > Sun's code limiting you there though you do need to compile and install > > > rxtx for the XScale with Sun's Commapi. > > > > > > -- > > > Trent Jarvi > > > tjarvi at qbang.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Wed Jun 8 12:16:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 08 Jun 2005 13:16:03 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A60B8D.8080500@cs.umn.edu> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> Message-ID: <42A735E3.8040706@atcorp.com> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual serial comport. This isn't so much of a problem, what is, however, is that the comport does not appear to be able to be set to any arbitrary speed, only those from the data_rate enum. I've not found much on using different speeds, has anyone else encountered anything similar? I greatly appreciate any and all comments and suggestions. Thanks in advance, ~ Shawn Lavelle From zempftman at gmail.com Wed Jun 8 12:50:58 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 14:50:58 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: Thanks Trent! That will solve one of the problems. I don't know when my next chance to work on it will be, but I still need to figure out the error I got when I tried opening '/dev/ttyS0' on the Moxa device regarding a failed assertion, seemed to be a Kaffe issue. Thanks for you help, hope to have results soon, Max Englander. On 6/8/05, Trent Jarvi wrote: > On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > > > ---------- Forwarded message ---------- > > From: Maxwell Zempftman > > Date: May 27, 2005 5:01 PM > > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > > To: rxtx at mail.linuxgrrls.org > > > > > > Here are the results from working this week: > > > > The "NullPointerExceptions" are generated by the software when I > > choose a bad device file. I discovered that this occurs on the > > i686-RedHat box as well. This exception seems to be generated only by > > this particular application, and not by the example programs in > > contrib. So, for example: > > > > java MyApp /dev/null <-- generates NullPointerException > > java MyApp fake <-- generates NullPointerException > > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > > > Using the program CommCheck > > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > > appears as though /dev/ttyS0 is the only valid serial device file on > > the XScale device, so the errors I was getting are not really be bugs. > > > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > > encounter this error: > > > > --start > > > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > > > PortList.hasMoreElements: true > > Listening on: /dev/ttyS0 > > Client connected. > > >From net: echo > > > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > > > --end > > > > I took a look at exception.h, and it seems as though the problematic > > code does not exist in newer versions of Kaffe (I have been using > > CVS-2004-11). Next week I will try to use a newer version, although so > > far everything but CVS-2004-11 has failed. Also, I the device files I > > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > > something like this? > > > > > In RXTXCommDriver, just look for the following code and add /dev/ttyM to > the list. Moxa? > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > So: > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyM", // for Moxa ports > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > Linux just has way too many port types to try enumerating them all. There > is potential we can add them back in with udev now. > > > > > Thanks, > > Max. > > > > > On 5/21/05, Trent Jarvi wrote: > > > > I'm not sure what is wrong in the first part. It sounds like your > > > > application may be swallowing an exception while trying to enumerate the > > > > port or open it. The usual mistake made it not having permissions to > > > > either open the port or create the lockfile. There should be examples in > > > > the contrib directory you can try that enumerate and open ports. Maybe > > > > that will give you some hints. > > > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > > Sun's code limiting you there though you do need to compile and install > > > > rxtx for the XScale with Sun's Commapi. > > > > > > > > -- > > > > Trent Jarvi > > > > tjarvi at qbang.org > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- > Trent Jarvi > tjarvi at qbang.org > From taj at www.linux.org.uk Wed Jun 8 12:53:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 19:53:10 +0100 (BST) Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A735E3.8040706@atcorp.com> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: On Wed, 8 Jun 2005, Shawn Lavelle wrote: > Hello, > I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate > with a virtual serial comport. This isn't so much of a problem, what > is, however, is that the comport does not appear to be able to be set to > any arbitrary speed, only those from the data_rate enum. I've not found > much on using different speeds, has anyone else encountered anything > similar? I greatly appreciate any and all comments and suggestions. > This problem is a bit more tricky than it should be. POSIX systems just have a few specified baud rates. Solaris is one of these systems. CommAPI baud rates probably came from someone looking at Solaris. RXTX tries to be POSIX like. W32 is treated as a POSIX like system via a termios.c file in rxtx. Serial ports have baudbase and divisor. So you can set these to come close to the baudrate you want. Some funky equipment like automobile test equipment use baud rates that are not really possible with PC hardware. But if you get as close as possible by changing baud base and divisor, it works. Windows can actually do this for you. I don't know exactly what their code does but if you pass a baudrate to windows, it will guestimate a baudbase and divisor. So you just pass it 10200 baud and it does its job. This is not of very much use the way rxtx does things though. Linux has the standard POSIX like baud rates but if you set the baud rate to B38400, you can set your own baud base and divisor. This is not POSIX that I know of. W32 has more capability than POSIX like systems too. So I did some work to have windows work like Linux via termios.c But the code is not quit right. SerialImp.c and termios.c need some work so all the various buadrates work on Linux and W32. Most other systems will not work beyond what CommAPI already specifies without writting kernel drivers. This is on my todo list but if someone gets to it first, all the better. -- Trent Jarvi tjarvi at qbang.org From carobizar at free.fr Thu Jun 9 06:39:10 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Thu, 9 Jun 2005 14:39:10 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: <1118320750.42a8386e6d3ce@imp5-q.free.fr> Hi ! Thank you for all your advices. I managed to use rxtx on Windows but I have still some difficulties on Linux. I have yet follow your instructions and the configure file has created : - librxtxSerial.so and librxtxParallel.so in the directory /usr/java/j2sdk1.4.2_08/jre/lib/i386 - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the directory /usr/java/j2sdk1.4.2_08/jre/lib - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext But when I run my program, Some exceptions occur : Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver So, 1) What have I forgotten ? 2) Is it possible to make my application run on Linux without the jdk (only the jre) ? Best regards, Caroline. From taj at www.linux.org.uk Thu Jun 9 07:28:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 9 Jun 2005 14:28:05 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118320750.42a8386e6d3ce@imp5-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: On Thu, 9 Jun 2005 carobizar at free.fr wrote: > Hi ! > Thank you for all your advices. > I managed to use rxtx on Windows but I have still some difficulties on Linux. > I have yet follow your instructions and the configure file has created : > - librxtxSerial.so and librxtxParallel.so in the directory > /usr/java/j2sdk1.4.2_08/jre/lib/i386 > - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the > directory /usr/java/j2sdk1.4.2_08/jre/lib > - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext > > But when I run my program, Some exceptions occur : > Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while > loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > com.sun.comm.SolarisDriver > > So, > 1) What have I forgotten ? > The native (.so) libraries are not installed in a directory the JRE is looking for native libraries in. You may look around and see where the .so libraries are in the JRE. I don't know that the jre/lib/i386 directory is specified as a required directory for JREs. I noticed some do not use it. You may try printing the java.libarary.path to see your options. It is also possible to alter the java.library.path. > 2) Is it possible to make my application run on Linux without the jdk (only the > jre) ? Yes. Though installation from source with the JDK is less error prone. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0399.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 7 15:03:09 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 07 Jun 2005 16:03:09 -0500 Subject: [Rxtx] Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <42A60B8D.8080500@cs.umn.edu> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual comport. This isn't so much of a problem, what is, however, is that the comport is only ever set to 9600 baud. I've not found this as a documented bug, has anyone else encountered anything similar? I'll try and provide more detail tomorrow, but if anyone has any suggestions or encountered this before, I'd like to hear about it. Thanks in advance, ~ Shawn Lavelle From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0402.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0402.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0402.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Mon Jun 20 01:04:40 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 20 Jun 2005 08:04:40 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: <42B66A88.4060806@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050620/9be208a1/attachment-0402.html From fbalzarro at libero.it Mon Jun 20 02:33:52 2005 From: fbalzarro at libero.it (Fabio Balzarro) Date: Mon, 20 Jun 2005 10:33:52 +0200 Subject: [Rxtx] RXTXPort:close detected bad file descriptor Message-ID: I'm using RXTX libraries on IPAQ 4150 PDA with Windows CE 4.20 and Jeode. When I close a serial port with sp.close() (where sp is a SerialPort) sometimes an error occour 1119256168085: RXTXPort:close detected bad file descriptor What can I do? Thanks Fabio ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From slavelle at atcorp.com Mon Jun 20 08:08:19 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 20 Jun 2005 09:08:19 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: <42B6CDD3.4040409@atcorp.com> It turns out that I did have a driver-not-used issue which has now been resolved and I can use RxTx on it (had to add ttyUSB as a valid port), but only at standard baud rates. Does USB have the same restrictions on port speed as regular RS232? ~ Shawn Trent Jarvi wrote: > Just a note here. > > I have requested a FTDI usb device and they offered to send one for the > purpose of trying to get rxtx working. I have no idea how long that takes > though. > > > On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > > >>I'm afraid we're just using the latest version from the FTDI website. I've >>not yet played with linux properly with this and unfortunately I run gentoo >>and haven't yet successfully compiled in the ftdi driver. I'll let you know >>if I get any success. >> >>Appologies >> >>Christopher >> >>-----Original Message----- >>From: rxtx-bounces at mail.electronpusher.org >>[mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle >>Sent: 15 June 2005 00:00 >>To: Java RXTX discussion >>Subject: Re: [Rxtx] Virtual Com Ports >> >>Hmm, the latter sounds like a lot of work. It does find the virtual comport >>in windows, i must have just missed it earlier (sign of a long day). On the >>linux side, I suspect that something is not correct with the driver >>installation becuase it does not give me a tty for it :( >> >>Christopher, May I ask what driver you are using for your FTDI chip? >>Did you ever encounter problems with not getting a tty assigned for it? >> >> >> Thanks for all your help! >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>They will have to show up as a tty device in Linux. Probably ttyUSB? >>>That will need an entry in RXTXCommDriver.java. If they dont show up >>>as a tty device, rxtx cant treat it like a serial port. It just wont >> >>work. >> >>>With COM3, rxtx will try to open the port and perform a timed out read. >>>Usually if a port is not there, the read blows up or the open blows up. >>>Timing out is fine. COM3 used to share interrupts with COM1. I know >>>you can reassign ports in XP. RXTX scans up through COM255. You may >>>try moving it. >>> >>> >>>The code in question is the following in RXTXCommDriver.java >>> >>> >>> if(osName.equals("Linux")) >>> { >>> String[] Temp = { >>> "ttyS", // linux Serial Ports >>> "ttySA", // for the IPAQs >>> "ttyUSB" // for USB frobs >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>> else if(osName.toLowerCase().indexOf("windows") != -1 ) >>> { >>> String[] Temp = { >>> "COM" // win32 serial ports >>> //"//./COM" // win32 serial ports >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>>If COM3 can be read, it should be found. the ttyUSB should work if >>>thats in the version of RXTXCommDriver.java you have. >>> >>>If this is still a problem, it may be that the driver is erroring on >>>what may be considered normal comm port operations such as setting the >>>speed, timeout, threshold, .. One would have to start looking at each >>>function called in the native open() and read(). >>> >>> >>> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>>seems to find the device using rxtx. Looking at the hardware >>>>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>>>linux. I can't seem to get it to show up as a tty(s#) in linux which >>>>is probably just due to my lack of significant linux knowledge. >>>> >>>> ~ Shawn >>>> >>>>Trent Jarvi wrote: >>>> >>>> >>>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>Has anyone here noticed that virtual comports do not get enumerated >>>>>>via CommPortIdentifier.getPortIdentifiers()?? >>>>>> >>>>>>The device I'm trying to talk to uses an fdti usb to serial >>>>>>convertor with a driver that has it show up as a virtual comport. I >>>>>>can enter this port manually and it will be usable but I cannot get >>>>>>it show up automatically (as in the simple serial demo). Any thoughts >> >>on this? >> >>>>> >>>>>Hi Shawn, >>>>> >>>>>What OS is this and what is the name of the virtual port you are >>>>>trying to open? I suspect the name just needs to be added to >> >>RXTXCommDriver.java. >> >>>>_______________________________________________ >>>>Rxtx mailing list >>>>Rxtx at mail.electronpusher.org >>>>http://www.electronpusher.org/mailman/listinfo/rxtx >>>> >>> >>> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From lyon at docjava.com Mon Jun 20 15:06:08 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 20 Jun 2005 17:06:08 -0400 Subject: [Rxtx] testing Message-ID: Hi All, I am testing my new multi-platform Java Webstart RXTX application (Trent: I could not have done it without you!). So far, I think it will work under Linux (x86), Windows XP, Windows 2000 and MacOS X. The application is available as a Java webstart application at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Edit:Preferences: SerialPort Setup... should bring up a dialog box that enables dialing via the modem. Generally, it does not find internal modems (except on the mac). Why, I don't know. Thanks in advance for trying this new app. All feedback on it is welcome. - Doug Lyon From jasmine at electronpusher.org Tue Jun 21 04:15:53 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Tue, 21 Jun 2005 11:15:53 +0100 Subject: [Rxtx] testing In-Reply-To: References: Message-ID: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > Hi All, > I am testing my new multi-platform Java Webstart RXTX application > (Trent: I could not have done it without you!). > > So far, I think it will work under Linux (x86), Windows XP, > Windows 2000 and MacOS X. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. -J. From taj at www.linux.org.uk Tue Jun 21 05:50:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 12:50:23 +0100 (BST) Subject: [Rxtx] testing In-Reply-To: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> References: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> Message-ID: On Tue, 21 Jun 2005, Jasmine Strong wrote: > > On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > > > Hi All, > > I am testing my new multi-platform Java Webstart RXTX application > > (Trent: I could not have done it without you!). > > > > So far, I think it will work under Linux (x86), Windows XP, > > Windows 2000 and MacOS X. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > on my Mac. > passing -source 1.3 -target 1.3 to javac will compile classes without this problem. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 10:19:25 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 11:19:25 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. Sincerely, Jeremyah Payne From ricardo.trindade at emation.pt Tue Jun 21 13:25:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 20:25:00 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B8698C.2060509@emation.pt> Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > From taj at www.linux.org.uk Tue Jun 21 13:39:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:39:43 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <42B8698C.2060509@emation.pt> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> <42B8698C.2060509@emation.pt> Message-ID: It looks like he has an rs422 device/converter. This is not the problematic 'trying to do protocol X with a serial port' situation unless I'm missing something. I'll follow up with the other email I started. On Tue, 21 Jun 2005, Ricardo Trindade wrote: > Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. > > Payne, Jeremyah L (N-CIM) wrote: > > >Good morning, my name is Jeremyah and I am working on a java project to > >interface with some devices. In short, I have a laptop with a PCMIA > >converter that does RS422 running windows 2000. I also will be > >installing some PCI cards into some Linux boxes that will have probably > >4-8 RS422 ports on them. After doing some reading in order to talk > >with these items using my existing java code I will need an additional > >driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > >trying to get a map sort of where I need to make changes. As I see it, > >I would need to subclass SerialPort to my RS422 interface. That would > >link with a DLL or SO implementation that talks with the hardware. I > >also need to change the listing of working ports in the lookup section > >for serial. Does this seem like I am on the right track? Appreciate > >the support. > > > > > >Sincerely, > >Jeremyah Payne > >_______________________________________________ > >Rxtx mailing list > >Rxtx at mail.electronpusher.org > >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 21 13:40:25 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:40:25 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: On Tue, 21 Jun 2005, Payne, Jeremyah L (N-CIM) wrote: > Good morning, my name is Jeremyah and I am working on a java project to > interface with some devices. In short, I have a laptop with a PCMIA > converter that does RS422 running windows 2000. I also will be > installing some PCI cards into some Linux boxes that will have probably > 4-8 RS422 ports on them. After doing some reading in order to talk with > these items using my existing java code I will need an additional > driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > trying to get a map sort of where I need to make changes. As I see it, I > would need to subclass SerialPort to my RS422 interface. That would link > with a DLL or SO implementation that talks with the hardware. I also > need to change the listing of working ports in the lookup section for > serial. Does this seem like I am on the right track? Appreciate the > support. > Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 13:40:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 14:40:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618954@emss02m08.us.lmco.com> I'd like to except I am dealing with NASA. I am basically building a system to monitor 100+ Units that communicate over RS422. They have some converters in place but want to get rid of them. I'll check through the archives. I had started looking yesterday as was leaving work. -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Ricardo Trindade Sent: Tuesday, June 21, 2005 2:25 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From slavelle at atcorp.com Tue Jun 21 14:58:06 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 21 Jun 2005 15:58:06 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: <42B87F5E.4000403@atcorp.com> > Linux has the standard POSIX like baud rates but if you set the baud rate > to B38400, you can set your own baud base and divisor. This is not POSIX > that I know of. W32 has more capability than POSIX like systems too. So > I did some work to have windows work like Linux via termios.c > > But the code is not quit right. SerialImp.c and termios.c need some > work so all the various buadrates work on Linux and W32. Most other > systems will not work beyond what CommAPI already specifies without > writting kernel drivers. > > This is on my todo list but if someone gets to it first, all the better. Hmm, I guess I didn't read this close enough before. Just to be clear, the pieces to setBaudBase and setDivisor are not yet implemented, correct? Thanks, Shawn From sean_montgomery at baseview.com Tue Jun 21 15:14:08 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 21 Jun 2005 17:14:08 -0400 Subject: [Rxtx] OS X installation - file locations Message-ID: <8AB82C7F-0D19-45F9-AE54-A12C59A8495E@baseview.com> Greetings, I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) using the RXTX installation instructions. RXTX worked fine. Basically you've got: - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions - javax.comm.properties in /System/Library/Frameworks/ JavaVM.framework/Home/lib - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ lib/ext My coworker was concerned that the installation required files to be placed in /System/Library... because those directories are "Apple's" and subject to change at Apple's whim, and that it would be safer (less likely to break when a user updates their OS or Java version or what have you) if all the files could be somewhere in /Library... or / Library/Java. My coworker points out that when 3rd party apps like FrontBase and JBoss need to communicate with Java their jars are placed in /Library/Java/Extensions. Granted that RXTX 2.0 is implementing javax.comm and not just a 3rd party extension, might that be the case - that javax.* stuff needs to be in the Java system files? I'm not the Java maven that my coworker is, so I don't know if any of this is gospel or not. Any OS X/Java experts out there willing to comment? We'd like to be able to install RXTX in the safest, most maintenance free way possible, but if there are specific reasons why javax.comm.properties and comm.jar need to be in /System... then so be it. Any information is welcome, Sean From ricardo.trindade at emation.pt Tue Jun 21 15:56:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 22:56:53 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B88D25.7060604@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050621/f6c9f5fe/attachment-0402.html From jeremyah.l.payne at lmco.com Tue Jun 21 15:22:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 16:22:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618955@emss02m08.us.lmco.com> -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Trent Jarvi Sent: Tuesday, June 21, 2005 2:40 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 As of yet we have not decided on the PCI boards to use yet So I am still waiting to se how we will interface to them. But the laptop is ready to use so ill build a test app for that API for now. The overview of class structure is really what I needed. I guess I will use the 2.1 as you suggested. Thanks for the help thus far! BTW, you guys wouldn't happen to keep class diagrams or anything of that nature around would you? If not I will probably end up having to do some anyway for documentation purposes, I could include them. Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From dmarkman at mac.com Tue Jun 21 18:13:28 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 21 Jun 2005 20:13:28 -0400 Subject: [Rxtx] OS X installation - file locations In-Reply-To: References: Message-ID: <044F520C-585C-4B99-82ED-3BA83DB8CE77@mac.com> Apple doesn't recommend to put jars into the /System/Library/Frameworks/JavaVM.framework/Home/lib/ext folder from other hands it's standard java directory to put extentions if you want to support comm api on whole system then I'd recommend to put jars into the /Library/Java/Extensions folder just like you did if you want to support comm api per user put your jars into the ~/ Library/Java/Extensions On Jun 21, 2005, at 5:14 PM, Java RXTX discussion wrote: > Greetings, > > > I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) > using the RXTX installation instructions. RXTX worked fine. > > > Basically you've got: > - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions > - javax.comm.properties in /System/Library/Frameworks/ > JavaVM.framework/Home/lib > - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ > lib/ext > > > My coworker was concerned that the installation required files to be > placed in /System/Library... because those directories are "Apple's" > and subject to change at Apple's whim, and that it would be safer > (less likely to break when a user updates their OS or Java version or > what have you) if all the files could be somewhere in /Library... or / > Library/Java. My coworker points out that when 3rd party apps like > FrontBase and JBoss need to communicate with Java their jars are > placed in /Library/Java/Extensions. Granted that RXTX 2.0 is > implementing javax.comm and not just a 3rd party extension, might > that be the case - that javax.* stuff needs to be in the Java system > files? > > > I'm not the Java maven that my coworker is, so I don't know if any of > this is gospel or not. Any OS X/Java experts out there willing to > comment? We'd like to be able to install RXTX in the safest, most > maintenance free way possible, but if there are specific reasons why > javax.comm.properties and comm.jar need to be in /System... then so > be it. > > > Any information is welcome, > > > Sean > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Dmitry Markman Dmitry Markman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050622/beea65d0/attachment-0402.html From lyon at docjava.com Thu Jun 23 04:39:47 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 23 Jun 2005 06:39:47 -0400 Subject: [Rxtx] web start + RXTX = strange errors? Message-ID: On: Date: Tue, 21 Jun 2005 11:15:53 +0100 From: Jasmine Strong Writes: An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. ----------- I cannot duplicate your error. My version of Java is: java -version java version "1.4.2_05" Is yours the same? Trent: You wrote: passing -source 1.3 -target 1.3 to javac will compile classes without this problem. ----------- OK, I have updated the disto to work with jdk1.3: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Jasmine: Is this working any better? Thanks! - DL From handzisk at tkn.tu-berlin.de Fri Jun 24 02:37:14 2005 From: handzisk at tkn.tu-berlin.de (Vlado Handziski) Date: Fri, 24 Jun 2005 10:37:14 +0200 (CEST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace Message-ID: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Hi all, let me first express my compliments on the great work you have done with the RXTX library. We have been using the library for some time, and we are at a point where we want to make our code public. For legacy reasons, the code that the RXTX library is bundled with, uses the javax.comm namespace. We have been using the ChangePackage script to change the RXTX2.1 package from gnu.io into javax.comm. We need the independent implementation since we want to be able to directly access /dev/ttyUSBx ports in linux and the CommAPI versions are just not as stable. On the download page, there is a comment that this is in violation of sun's license. Can someone shed more light on this. I was not aware that you can protect the names of the java packages. Best regards, Vlado From ricardo.trindade at emation.pt Fri Jun 24 04:01:17 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 11:01:17 +0100 Subject: [Rxtx] parity missed Message-ID: <42BBD9ED.3060004@emation.pt> Hi, I have a "parity missed error". From previous posts I believe this has to do with CMSPAR not being defined. I checked out 2.1 head from CVS. How can I make sure I do a proper build and CMSPAR is defined ? Perhaps it would be good to have a release snapshot that has this, I think the latest snapshot (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. Another question I have, is why must this depend on kernel headers, why can't it be defined in the RXTX source ? thanks Ricardo From jasmine at electronpusher.org Fri Jun 24 04:09:06 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 24 Jun 2005 11:09:06 +0100 Subject: [Rxtx] web start + RXTX = strange errors? In-Reply-To: References: Message-ID: <644aad2bdbba950f0a2fb12d7dcfd8a6@electronpusher.org> On 23 Jun 2005, at 11:39, Dr. Douglas Lyon wrote: > OK, I have updated the disto to work with jdk1.3: > http://show.docjava.com:8086/book/cgij/code/jnlp/ > addbk.JAddressBook.Main.jnlp > > Jasmine: Is this working any better? Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) -J. From taj at www.linux.org.uk Fri Jun 24 10:54:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 17:54:12 +0100 (BST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: On Fri, 24 Jun 2005, Vlado Handziski wrote: > Hi all, > > let me first express my compliments on the great work you have done with > the RXTX library. > > We have been using the library for some time, and we are at a point where > we want to make our code public. For legacy reasons, the code that the > RXTX library is bundled with, uses the javax.comm namespace. We have been > using the ChangePackage script to change the RXTX2.1 package from gnu.io > into javax.comm. We need the independent implementation since we want to > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > versions are just not as stable. > > On the download page, there is a comment that this is in violation of > sun's license. Can someone shed more light on this. I was not aware that > you can protect the names of the java packages. > > Best regards, > Vlado > I can't provide legal advice as I am not a lawyer. (v) may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are contained in the "java", "javax" or "sun" packages or similar as specified by Sun in any class file naming convention; and The license is in the commapi package from Sun. The above is also in all the EULA's you click through to download from Sun if I'm not mistaken. Simply put, the license taints developers that agree to it. For those developers, Sun has control of the javax.comm namespace. It really does not make sense to put rxtx 2.1 in the javax.comm namespace. It will only cause confusion which I think is the point of the clause above. The gnu.io namespace was perhaps a poor choice and just tossed in when reviewing the license to get out of Sun's namespace. There is nothing in the rxtx license limiting your freedom in this fashion though. Many companies are moving to gnu.io and some distribute it with popular applications you would recognize. I'm tempted to ask you not to contaminate rxtx 2.1 with the javax.comm namespace. You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) extensions to existing classes (which I dont think you are using); it is not just javax.comm. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 24 13:24:09 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 20:24:09 +0100 (BST) Subject: [Rxtx] parity missed In-Reply-To: <42BBD9ED.3060004@emation.pt> References: <42BBD9ED.3060004@emation.pt> Message-ID: On Fri, 24 Jun 2005, Ricardo Trindade wrote: > Hi, > > I have a "parity missed error". From previous posts I believe this > has to do with CMSPAR not being defined. > I checked out 2.1 head from CVS. How can I make sure I do a proper > build and CMSPAR is defined ? Perhaps it would be good to have a release > snapshot that has this, I think the latest snapshot > (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. > > Another question I have, is why must this depend on kernel headers, > why can't it be defined in the RXTX source ? > I used to cheat and grab the CMSPAR from the kernel headers because glibc did not have it. Now rxtx uses the glibc headers and we have a patch in glibc I trust that handles this. It would not be right to override glibc and it wasnt right to use the kernel headers (it really did cause problems). You can override glibc for now with the following in the top of SerialImp.c # define CMSPAR 010000000000 You can check if your distro headers have this right bit looking for the above in bits/termios.h. It should look like this: #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif If it is not defined, please file a bug with your distro as rxtx is not the only thing that will be broken on that distro. I was going to release new cvs snapshots last weekend but got tied up. I'll do it this weekend. I also need to get custom baudrate patches into the cvs snapshot. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Fri Jun 24 13:56:50 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 20:56:50 +0100 Subject: [Rxtx] parity missed In-Reply-To: References: <42BBD9ED.3060004@emation.pt> Message-ID: <42BC6582.2070805@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050624/e3b39631/attachment-0402.html From vlado.handziski at gmail.com Sat Jun 25 06:25:52 2005 From: vlado.handziski at gmail.com (Vlado Handziski) Date: Sat, 25 Jun 2005 14:25:52 +0200 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: <697986ec05062505256ebf381f@mail.gmail.com> Thanks for the clarification. Since changing the bundled source is not an option at this moment, we will consider using javax.comm and RXTX2.0. In the next rewrite, we would probably move to gnu.io . Best regards, Vlado Handziski On 6/24/05, Trent Jarvi wrote: > > On Fri, 24 Jun 2005, Vlado Handziski wrote: > > > Hi all, > > > > let me first express my compliments on the great work you have done with > > the RXTX library. > > > > We have been using the library for some time, and we are at a point > where > > we want to make our code public. For legacy reasons, the code that the > > RXTX library is bundled with, uses the javax.comm namespace. We have > been > > using the ChangePackage script to change the RXTX2.1 package from gnu.io > > into javax.comm. We need the independent implementation since we want to > > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > > versions are just not as stable. > > > > On the download page, there is a comment that this is in violation of > > sun's license. Can someone shed more light on this. I was not aware that > > you can protect the names of the java packages. > > > > Best regards, > > Vlado > > > > I can't provide legal advice as I am not a lawyer. > > (v) may not create, or authorize your licensees to create additional > classes, interfaces, or subpackages that are contained in the "java", > "javax" or "sun" packages or similar as specified by Sun in any class file > naming convention; and > > The license is in the commapi package from Sun. The above is also in all > the EULA's you click through to download from Sun if I'm not mistaken. > > Simply put, the license taints developers that agree to it. For those > developers, Sun has control of the javax.comm namespace. > > It really does not make sense to put rxtx 2.1 in the javax.comm namespace. > It will only cause confusion which I think is the point of the clause > above. The gnu.io namespace was perhaps a poor choice and > just tossed in > when reviewing the license to get out of Sun's namespace. > > There is nothing in the rxtx license limiting your freedom in this fashion > though. Many companies are moving to gnu.io and some > distribute it with > popular applications you would recognize. I'm tempted to ask you not > to contaminate rxtx 2.1 with the javax.comm namespace. > > You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm > using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) > extensions to existing classes (which I dont think you are using); it is > not just javax.comm. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050625/1dadc50e/attachment-0402.html From taj at www.linux.org.uk Sun Jun 26 11:34:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 26 Jun 2005 18:34:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. Message-ID: The attached file should fix baud_base and divisor extensions for Linux The patch is against rxtx 2.1 CVS HEAD. To use this patch, you should set the baud rate to 38400. You can then try SerialPort.setBaudBase(int) and SerialPort.setDivisor(int) There are matching int SerialPort.getBaudBase() and int SerialPort.getDivisor(). What baud bases are available depends upon the serial port card and its driver so this is a bit of a blind attempt on my part. I've looked at the w32 API and I dont see anything available yet. The w32 code in RXTX will probably be figuring out the baud rate based on the tried baud base and divisor and just slamming it at the API for now (the API does something with that but I've not found real documentation on what it does). I dont want to try tinkering with the UART directly yet as that would involve poking machine memory directly and could very easily be error prone in bad ways. I don't expect Solaris or any SysV UNIX systems to work at all with this - ever. It is not standard in any way and will throw Exceptions on everything but Linux (w32 will just fail miserably as it is 1/2 implemented). If anyone has looked at custom baud rates before and has some thoughts or just wants to try the attached untested patch, I'd appreciate any feedback. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- ? autom4te.cache ? build ? output cvs server: Diffing . Index: configure =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure,v retrieving revision 1.35.2.59 diff -u -r1.35.2.59 configure --- configure 16 Oct 2004 16:20:34 -0000 1.35.2.59 +++ configure 26 Jun 2005 16:59:28 -0000 @@ -9644,6 +9644,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { #if defined (__GLIBC__) @@ -9782,6 +9784,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { @@ -9825,7 +9829,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -9837,7 +9841,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 26 Jun 2005 16:59:28 -0000 @@ -218,6 +218,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { #if defined (__GLIBC__) @@ -356,6 +358,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { @@ -399,7 +403,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -411,7 +415,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" cvs server: Diffing CNI cvs server: Diffing MACOSX_IDE cvs server: Diffing MACOSX_IDE/CW cvs server: Diffing MACOSX_IDE/ForPackageMaker cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions cvs server: Diffing MACOSX_IDE/ForPackageMaker/Resources cvs server: Diffing MACOSX_IDE/PB cvs server: Diffing WinCE cvs server: Diffing contrib cvs server: Diffing debian cvs server: Diffing src Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 26 Jun 2005 16:59:29 -0000 @@ -2079,15 +2079,17 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int BaudBase The clock frequency divided by 16. Default * BaudBase is 115200. * @return boolean true on success - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:setBaudBase()"); @@ -2097,10 +2099,11 @@ /** * Extension to CommAPI * @return int BaudBase - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getBaudBase() throws UnsupportedCommOperationException + public int getBaudBase() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getBaudBase()"); @@ -2108,13 +2111,14 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, IOException { if ( debug ) z.reportln( "RXTXPort:setDivisor()"); @@ -2124,10 +2128,11 @@ /** * Extension to CommAPI * @returns int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getDivisor() throws UnsupportedCommOperationException + public int getDivisor() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getDivisor()"); Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 26 Jun 2005 16:59:30 -0000 @@ -1877,16 +1877,27 @@ int fd = get_java_var( env, jobj,"fd","I" ); struct serial_struct sstruct; + if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) + { + goto fail; + } + + sstruct.baud_base = (int) BaudBase; + if ( sstruct.baud_base < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetBaudBase", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetBaudBase", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1914,9 +1925,13 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) ( sstruct.baud_base ) ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetBaudBase", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetBaudBase", strerror( errno ) ); @@ -1950,19 +1965,23 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } if ( sstruct.custom_divisor < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetDivisor", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetDivisor", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1971,7 +1990,7 @@ accept: none perform: Find the Divisor used for custom speeds - return: Divisor + return: Divisor negative value on error. exceptions: Unsupported Comm Operation on systems not supporting TIOCGSERIAL comments: @@ -1990,10 +2009,14 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) sstruct.custom_divisor ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetDivisor", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetDivisor", strerror( errno ) ); @@ -2032,7 +2055,7 @@ /* Open and lock the port so nothing else changes the setting */ - if ( LOCK( filename, pid ) ) goto fail;; + if ( LOCK( filename, pid ) ) goto fail; fd = find_preopened_ports( filename ); if( !fd ) Index: src/SerialPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/Attic/SerialPort.java,v retrieving revision 1.3.2.9 diff -u -r1.3.2.9 SerialPort.java --- src/SerialPort.java 12 Oct 2004 08:59:28 -0000 1.3.2.9 +++ src/SerialPort.java 26 Jun 2005 16:59:30 -0000 @@ -103,13 +103,17 @@ public abstract String getUARTType() throws UnsupportedCommOperationException; public abstract boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getBaudBase() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getDivisor() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setLowLatency() throws UnsupportedCommOperationException; public abstract boolean getLowLatency() cvs server: Diffing src/lfd cvs server: Diffing src/psmisc From uwe at kubosch.no Mon Jun 27 14:13:57 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Mon, 27 Jun 2005 22:13:57 +0200 Subject: [Rxtx] RXTX on FC4 Message-ID: <1119903238.2989.27.camel@BPC0276> Hi all! I just got RXTX to work on Fedora Core 4. The standard download did not work. I had to check the code out from CVS and build it, but then it worked flawlessly. Thanks for your good work. Now I wonder if I should contribute the compiled files so that others will have an easier time than me getting RXTX to work on FC4. What do I do? Who do I talk to? donV From taj at www.linux.org.uk Mon Jun 27 14:29:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 27 Jun 2005 21:29:46 +0100 (BST) Subject: [Rxtx] RXTX on FC4 In-Reply-To: <1119903238.2989.27.camel@BPC0276> References: <1119903238.2989.27.camel@BPC0276> Message-ID: On Mon, 27 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I just got RXTX to work on Fedora Core 4. > > The standard download did not work. > > I had to check the code out from CVS and build it, but then it worked > flawlessly. > > Thanks for your good work. > > Now I wonder if I should contribute the compiled files so that others > will have an easier time than me getting RXTX to work on FC4. What do I > do? Who do I talk to? > > The best thing to do with FC is to contibute an extras RPM. Debian does something like this with their .deb packaging. As rxtx is OS neutral, it is almost impossible to have everything on rxtx.org. If you do get a package in Fedora Extras, I can point a link there. The extra's mail list is here: https://www.redhat.com/mailman/listinfo/fedora-extras-list If it would help to have me release a 'stable' .tar.gz of the source for the RPM submittal process I can do that. It would also trigger upgrades in debian which would not be bad. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Mon Jun 27 16:23:20 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 27 Jun 2005 17:23:20 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: Message-ID: <42C07C58.1030608@atcorp.com> Hey Trent, I installed it and now I get IOExceptions instead of the other one. I'm not sure how those changes would have enabled setDivisor and setBaudBase to work though. Is it significant that this is a USB device emulating a serial port? ~ Shawn From taj at www.linux.org.uk Mon Jun 27 18:07:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 01:07:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: <42C07C58.1030608@atcorp.com> References: <42C07C58.1030608@atcorp.com> Message-ID: On Mon, 27 Jun 2005, Shawn Lavelle wrote: > Hey Trent, > I installed it and now I get IOExceptions instead of the other one. > I'm not sure how those changes would have enabled setDivisor and > setBaudBase to work though. Is it significant that this is a USB device > emulating a serial port? > The USB driver probably does not support this. With USB, the ioctl()'s appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through the linux drivers/usb tree and found to ioctl to support this in Linux 2.6.10. RXTX is not doing very much magic, the patch really only gets the serial struct instead of writing a structure with random values for baudbase and handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel level driver issue not a user space library issue. So if you wanted this to work, the usb serial driver would have to handle the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression after looking through the USB tree quickly. I hope that helps. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Jun 27 18:25:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 27 Jun 2005 20:25:22 -0400 Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) Message-ID: Hi All, I wrote: Jasmine: Is this working any better? And Jasmine says: Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) I am using -source 1.3 and -target 1.3 for the compilation, however, we still seem to have this problem, which my machine (for some reason) does not have. Does anyone have any ideas about what might be the problem? Thanks! - DL From taj at www.linux.org.uk Mon Jun 27 19:04:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 02:04:37 +0100 (BST) Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) In-Reply-To: References: Message-ID: On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I wrote: > Jasmine: Is this working any better? > > And Jasmine says: > Nope. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > > I am using -source 1.3 and -target 1.3 > for the compilation, however, we still seem to have this problem, > which my machine (for some reason) does not have. > Does anyone have any ideas about what might be the problem? > This has shown up in the past with jdk 1.5 compiled jars running on jre 1.4 machines. My guess is either jasmine has an old copy of rxtx with the problem on her machine that is being picked up on the classpath or you have not tried this with jre 1.4. The suggested -source/target fix should avoid the problem. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Mon Jun 27 21:23:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 04:23:55 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: On Tue, 28 Jun 2005, Trent Jarvi wrote: > On Mon, 27 Jun 2005, Shawn Lavelle wrote: > > > Hey Trent, > > I installed it and now I get IOExceptions instead of the other one. > > I'm not sure how those changes would have enabled setDivisor and > > setBaudBase to work though. Is it significant that this is a USB device > > emulating a serial port? > > > > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > > RXTX is not doing very much magic, the patch really only gets the serial > struct instead of writing a structure with random values for baudbase and > handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel > level driver issue not a user space library issue. > > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. > > I hope that helps. > > > It may be possible that you can just modify translate_speed and get_java_baudrate in SerialImp.c to have the new high speds you are after. The defines are in /usr/include/termios.h. #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 You can see many of these are not handled. I dont think CommAPI handled more than 57600 or so. int get_java_baudrate( int native_speed ) { switch( native_speed ) { case B0: return 0; case B50: return 50; case B75: return 75; case B110: return 110; case B134: return 134; case B150: return 150; case B200: return 200; case B300: return 300; case B600: return 600; case B1200: return 1200; case B1800: return 1800; case B2400: return 2400; case B4800: return 4800; case B9600: return 9600; case B19200: return 19200; case B38400: return 38400; case B57600: return 57600; default: return -1; } } int translate_speed( JNIEnv *env, jint speed ) { LEAVE( "RXTXPort:translate_speed" ); switch( speed ) { case 0: return B0; case 50: return B50; case 75: return B75; case 110: return B110; case 134: return B134; case 150: return B150; case 200: return B200; case 300: return B300; case 600: return B600; case 1200: return B1200; case 1800: return B1800; case 2400: return B2400; case 4800: return B4800; case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; #ifdef B57600 case 57600: return B57600; #endif /* B57600 */ #ifdef B115200 case 115200: return B115200; #endif /* B115200 */ #ifdef B230400 case 230400: return B230400; #endif /* B230400 */ #ifdef B460800 case 460800: return B460800; #endif /* B460800 */ #ifdef B14400 case 14400: return B14400; #endif /* B14400 */ #ifdef B28800 case 28800: return B28800; #endif /* B28800 */ #ifdef B128000 /* dima */ case 128000: return B128000; #endif /* dima */ #ifdef B256000 /* dima */ case 256000: return B256000; #endif /* dima */ } /* Handle custom speeds */ if( speed >= 0 ) return speed; else { LEAVE( "RXTXPort:translate_speed: Error condition" ); return -1; } } -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 28 05:20:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 28 Jun 2005 07:20:21 -0400 Subject: [Rxtx] cross-compilation using Make for Mac Message-ID: Hi All, Please excuse the long post; Trent said: >" >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. " Here is what I have on the mac version: java -version java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) When I run: http://show.docjava.com:8086/book/cgij/code/jnlp/math.benchmarks.Dhry.jnlp I get: -- listing properties -- jnlpx.heapsize=NULL,NULL jnlpx.splashport=-1 java.runtime.name=Java(TM) 2 Runtime Environment, Stand... java.protocol.handler.pkgs=com.sun.javaws.net.protocol sun.boot.library.path=/System/Library/Frameworks/JavaVM.fra... java.vm.version=1.4.2-38 awt.nativeDoubleBuffering=true gopherProxySet=false http.auth.serializeRequests=true java.vm.vendor="Apple Computer, Inc." java.vendor.url=http://apple.com/ path.separator=: java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io jnlpx.home=/Applications/Utilities/Java/Java Web... user.country=US sun.os.patch.level=unknown java.vm.specification.name=Java Virtual Machine Specification user.dir=/ java.runtime.version=1.4.2_05-141.4 java.awt.graphicsenv=apple.awt.CGraphicsEnvironment java.endorsed.dirs=/System/Library/Frameworks/JavaVM.fra... os.arch=ppc java.io.tmpdir=/tmp line.separator= java.vm.specification.vendor=Sun Microsystems Inc. jnlpx.remove=false os.name=Mac OS X sun.java2d.fontpath= java.library.path=/Applications/Utilities/Java/Java Web... java.specification.name=Java Platform API Specification java.class.version=48.0 jnlpx.deployment.user.home=/Users/lyon/Library/Caches/Java Web S... java.util.prefs.PreferencesFactory=java.util.prefs.MacOSXPreferencesFactory os.version=10.3.9 user.home=/Users/lyon user.timezone=America/New_York java.security.policy=file:/Applications/Utilities/Java/Jav... java.awt.printerjob=apple.awt.CPrinterJob trustProxy=true java.specification.version=1.4 file.encoding=MacRoman jnlpx.deployment.system.home=/Applications/Utilities/Java/J2SE 5.0... user.name=lyon java.class.path=/Applications/Utilities/Java/Java Web... java.vm.specification.version=1.0 sun.arch.data.model=32 java.home=/System/Library/Frameworks/JavaVM.fra... java.specification.vendor=Sun Microsystems Inc. user.language=en awt.toolkit=apple.awt.CToolkit java.vm.info=mixed mode java.version=1.4.2_05 java.ext.dirs=/Users/lyon/Library/Java/Extensions:/... sun.boot.class.path=/System/Library/Frameworks/JavaVM.fra... java.vendor=Apple Computer, Inc. file.separator=/ java.vendor.url.bug=http://developer.apple.com/java/ sun.cpu.endian=big sun.io.unicode.encoding=UnicodeBig mrj.version=141.3 jnlpx.jvm=/System/Library/Frameworks/JavaVM.fra... sun.cpu.isalist= sun.awt.exception.handler=apple.awt.CToolkit$EventQueueExceptio... javawebstart.version=javaws-1.4.2_05 800 mhz g4,878k ds/sec total time: 1184ms Result: 844594 dhrystone/sec. Load average for last 15 minutes:0.62 So, I feel pretty sure that I have tried this with 1.4. As to modifying the RXTX compilation, that I did not do...and I take your point. I have been using the binary distributions as is. Oops. I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Now when I do a make, I get: make gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known libtool: link: warning: undefined symbols not allowed in i386-pc-mingw32 shared libraries rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ln: `SerialImp.o': File exists make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 So, I do a make clean, then a make: .... (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ar cru .libs/librxtxSerial.a /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o ar: /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o: No such file or directory make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 In the i386 directory, there is a symbolic link left from something: ls -al SerialImp.o lrwxrwxrwx 1 lyon lyon 12 Jun 28 07:03 SerialImp.o -> SerialImp.lo However, the SerialImp.lo is not present (which is the cause of the error, I think). On the other hand, the file I am looking for is present in: i686-pc-linux-gnu Possibly the i386 generation is not clean (of course it is also likely that I am just asking dumb questions, being a newbie to the code and all.). Finally, will this make file regenerate the distro for the mac? I found some really old (from year 2001) files in: cvs/MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions Which I could use for the distro...but I would prefer to do a clean, multi-platform build from make. Thanks! - Doug >On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > >> Hi All, >> I wrote: >> Jasmine: Is this working any better? >> >> And Jasmine says: >> Nope. >> >> An error occurred while launching/running the application. >> >> Title: addbk.JAddressBook.Main >> Vendor: DocJava, Inc. >> Category: Unexpected Error >> >> gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) >> >> > > I am using -source 1.3 and -target 1.3 >> for the compilation, however, we still seem to have this problem, >> which my machine (for some reason) does not have. >> Does anyone have any ideas about what might be the problem? >> > >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. > > >The suggested -source/target fix should avoid the problem. > >-- >Trent Jarvi >tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 28 09:43:41 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 28 Jun 2005 10:43:41 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: <42C1702D.1070307@atcorp.com> > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. There is ioctl stuff in the driver for the chip, but i haven't seen the TIOC*SERIAL entries. That might be why it continues to fail. I did get around the problem, though, by hacking the driver and just specifying the baud rate I need. Now everything works well. Thanks for all the assistance you've provided. ~ Shawn M. Lavelle From taj at www.linux.org.uk Tue Jun 28 12:42:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:42:29 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known Add a compiler flag -DWIN32 The code above should not be compiling on w32 as it is #if !defined(WIN32) You can look at the bottom of Makefile.in to see the w32 compile flags. Search for "WIN32 CrossCompiling from here down" If its still not working, I can set you up with the Bob account. Just email me off the list. W32 compiling is a bit complicated. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 28 12:52:50 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:52:50 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Nods. I did change configure but right now it is only in the baudbase/divisor patch I posted. I'm going to add several extension baud rates that can be supported by normal API calls and commit that today as a followup to my comments yesterday on baudrates. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Wed Jun 29 01:52:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 08:52:10 +0100 (BST) Subject: [Rxtx] [PATCH] More baud rate fixes Message-ID: I went through the native baudrate conversion from Java and added several. This patch is against CVS 2.1 head. I think thats it for baud rate fixes unless someone see something. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- A non-text attachment was scrubbed... Name: baud_base_and_divisor_plus_odd_baudrates.diff.gz Type: application/x-gzip Size: 3291 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050629/4c1ef1c2/baud_base_and_divisor_plus_odd_baudrates.diff-0402.gz From lyon at docjava.com Wed Jun 29 10:33:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 29 Jun 2005 12:33:45 -0400 Subject: [Rxtx] java.comm dependencies Message-ID: Hi All, During a build of the rxtx code, I have left the javax.comm out of the system (on purpose). However, I get an error, at run time: CommPortIdentifier:static initialization() apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: javax/comm/CommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver I am thinking that there is something in the gnu.io.CommPortIdentifier that seeks to load the javax.comm.CommDriver. It was my understanding that we could write code without reference to the javax.comm.CommDriver and that we could work in the gnu namespace. Is this true? Thanks! - Doug From taj at www.linux.org.uk Wed Jun 29 11:16:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 18:16:08 +0100 (BST) Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > During a build of the rxtx code, I have left the > javax.comm out of the system (on purpose). > However, I get an error, at run time: > > CommPortIdentifier:static initialization() > apple.awt.EventQueueExceptionHandler Caught Throwable : > java.lang.NoClassDefFoundError: javax/comm/CommDriver > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > that seeks to load the javax.comm.CommDriver. > > It was my understanding that we could write code without reference > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > Is this true? > Yes. People use 2.1 without javax all the time. There should be no reference to javax at all in rxtx 2.1. You may check your code. I just did a grep through 2.1 and there is nothing. You may look at the classes you are using. If you find javax.comm in your code, replace it with gnu.io and that should be all you need to do. -- Trent Jarvi tjarvi at qbang.org From jayant28k at gmail.com Wed Jun 29 21:49:28 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Thu, 30 Jun 2005 09:19:28 +0530 Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: <6a6a02310506292049778c452f@mail.gmail.com> Trent, I think best idea is to have wiki for rxtx code. So as the traffic is increasing with time. "RXTX" seems to be more popular in embbeded system. Sun Microsystems will always apperciate your efforts on parallel and serial ports commincation based application in IT Industry. Thanks for your help on this forum as "ONE MAN ARMY" ;-) Cheers, Jayant On 6/29/05, Trent Jarvi wrote: > On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > > > Hi All, > > During a build of the rxtx code, I have left the > > javax.comm out of the system (on purpose). > > However, I get an error, at run time: > > > > CommPortIdentifier:static initialization() > > apple.awt.EventQueueExceptionHandler Caught Throwable : > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > > that seeks to load the javax.comm.CommDriver. > > > > It was my understanding that we could write code without reference > > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > > > Is this true? > > > > Yes. People use 2.1 without javax all the time. > > There should be no reference to javax at all in rxtx 2.1. You may check > your code. I just did a grep through 2.1 and there is nothing. You may > look at the classes you are using. > > If you find javax.comm in your code, replace it with gnu.io and that > should be all you need to do. > > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From uwe at kubosch.no Sat Jun 25 02:50:24 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Sat, 25 Jun 2005 10:50:24 +0200 Subject: [Rxtx] RXTX in FC3/FC4 Message-ID: <1119689424.12606.14.camel@BPC0276> Hi all! I am trying to get RXTX to work on Fedora Core, version 3 or 4. I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext directory. I have edited the jre/lib/javax.comm.properties according to the docs. I have tried this with both rxtx 2.0 and 2.1. I have tried on two different machines. I have tried with java 1.4.2 and java 1.5.0, both from Sun. I always get a signall 11 from the native libraries when they are loaded. Is this a common problem? Any help is greatly appreciated. Below is the start of the error message. More can be supplied on demand. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x65015A Function=(null)+0x65015A Library=/lib/ld-linux.so.2 NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) - locked <0xed46f628> (a java.util.Vector) - locked <0xed471708> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xed46ebc0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.InitializeDriver(CommPortIdentifier.java:213) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:248) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:351) at com.jpeterson.x10.module.CM11A.allocate(CM11A.java:1160) at net.sourceforge.cruisecontrol.publishers.X10Publisher.send(X10Publisher.java:182) at net.sourceforge.cruisecontrol.publishers.X10Publisher.turnOff(X10Publisher.java:171) at net.sourceforge.cruisecontrol.publishers.X10Publisher.handleBuild(X10Publisher.java:148) at net.sourceforge.cruisecontrol.publishers.X10Publisher.publish(X10Publisher.java:141) at net.sourceforge.cruisecontrol.Project.publish(Project.java:679) at net.sourceforge.cruisecontrol.Project.build(Project.java:227) at net.sourceforge.cruisecontrol.Project.execute(Project.java:153) at net.sourceforge.cruisecontrol.ProjectWrapper.run(ProjectWrapper.java:66) at java.lang.Thread.run(Thread.java:534) From chris_jh at blueyonder.co.uk Tue Jun 28 05:37:10 2005 From: chris_jh at blueyonder.co.uk (Christopher Harris) Date: Tue, 28 Jun 2005 12:37:10 +0100 Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError Message-ID: <42C13666.9030108@blueyonder.co.uk> Hi I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 32bit) The serial ports work fine with no issues, but when i try to use the parallel port i get this message Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:66) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) I am trying to print a line out to port "/dev/lp0" At first i thought it could not find the librxtxParallel.so file, but when i renamed it i got a different saying it could not find the library. I have tried to run as root no difference. It is really weird, i get no compile errors and the serial ports work fine. I changed the LPRPort.java and commented out the Initialize call method. And just get the same error but for the method open. It is as though it can't see the methods, and yet it can see the library. I did have a bit of check of the JNI implementation in rxtx but could not spot anything. Yours Thankfully Christopher Harris From lyon at docjava.com Thu Jun 30 02:28:09 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 04:28:09 -0400 Subject: [Rxtx] tools Message-ID: Hi All, I have been thinking about automatic cross-platform native method development of Java/C programs. It appears that different binary tools are needed to target different platforms. Configuration seems a bit painful. Is there something better available than make? Is ANT any good at this? Has anyone tried: http://jnipp.sourceforge.net/ Thanks! - Doug From lyon at docjava.com Thu Jun 30 04:11:17 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 06:11:17 -0400 Subject: [Rxtx] javax.comm Message-ID: Hi All, When I load my jar files on a linux box, all is well. However, when I load them on a mac, I get: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver The jar files for the mac are different from the jar files for linux, because recompilation of the native code for the mac has not been easy, for me. As a result, the RXTX jars are tending toward specific versions and platforms. Probably, this is not an ideal situation, but, I suspect, it is common. I have an idea that we could create a single JNLP distro site that we can make reference to that would enable a uniform repository of synchronized signed native methods and jars for RXTX. For example, the one-wire Maxim folks have a real-nice approach where their stuff makes reference to another JNLP file that contains all the stuff we need to make RXTX work. Check it out at: http://www.maxim-ic.com/products/ibutton/software/1wire/OneWireViewer.cfm However, even they have problems on an unconfigured machine: Specified adapter name "DS9097U" is not known * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cannot load default adapter. Please check that the adapter is connected and that no other application is using the port. If you have checked the adapter, the default port might not be selected. Either set the value of the TMEX default using the utility provided with the TMEX Runtime, or create a new file in the /lib folder called onewireviewer.properties with two lines, similar to the following: #native win32 drivers adapter.name={DS9097U} adapter.port=COM1 #or javax.comm drivers adapter.name=DS9097U adapter.port=COM1 The full path to this file should be: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/onewireviewer.properties ---- Wow, that is a show stopper! Configuration is something that we really need to think about as an automatic thing, particularly for web start users. You can't ask a person who wants to run an application to figure out how to alter a properties file. If you know you need one, then get permission and make one...automatically. That makes a lot of sense, to me. Basically, we need an installer. At the very least, all the pre-built binaries and jars needed for the RXTX package on several platforms should be available from a single place. One this happens, we can make a JNLP file that is platform specific, but can give us a level of indirection. Is this something that has been done already? Thanks! - Doug From taj at www.linux.org.uk Thu Jun 30 08:10:22 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 15:10:22 +0100 (BST) Subject: [Rxtx] tools In-Reply-To: References: Message-ID: On Thu, 30 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I have been thinking about automatic cross-platform > native method development of Java/C programs. > > It appears that different binary tools are needed to target different > platforms. Configuration seems a bit painful. > > Is there something better available than make? > > Is ANT any good at this? I'm far from an Ant expert but have used it for other projects. The main problem I see with ant is there is no mainstream support for platform neutral neutral library creation as far as I can tell. I think ant is a fine replacement for make but I've not seen a suitable replacement for autoconf. At that point, make is as good as anything. It should be possible to create a ant build.xml that works on say Solaris, Linux, Windows and Mac OS X. The problem is when you are trying to build a library for embeded ARM from Mac OS X. > Has anyone tried: > http://jnipp.sourceforge.net/ -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:22:02 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:22:02 +0100 (BST) Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <1119689424.12606.14.camel@BPC0276> References: <1119689424.12606.14.camel@BPC0276> Message-ID: On Sat, 25 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I am trying to get RXTX to work on Fedora Core, version 3 or 4. > > I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 > directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext > directory. > > I have edited the jre/lib/javax.comm.properties according to the docs. > > I have tried this with both rxtx 2.0 and 2.1. > > I have tried on two different machines. > > I have tried with java 1.4.2 and java 1.5.0, both from Sun. > > I always get a signall 11 from the native libraries when they are > loaded. Is this a common problem? Any help is greatly appreciated. > Below is the start of the error message. More can be supplied on > demand. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x65015A > Function=(null)+0x65015A > Library=/lib/ld-linux.so.2 > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) If you compile rxtx from source, this will probably go away. I'm not sure what the exact cause is but it looks like the binaries are not suitable for FC3/4. The ABI may have changed since those had been compiled. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:26:56 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:26:56 +0100 (BST) Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError In-Reply-To: <42C13666.9030108@blueyonder.co.uk> References: <42C13666.9030108@blueyonder.co.uk> Message-ID: tOn Tue, 28 Jun 2005, Christopher Harris wrote: > Hi > > I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 > 32bit) > > The serial ports work fine with no issues, but when i try to use the > parallel port i get this message > > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:66) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) > > > I am trying to print a line out to port "/dev/lp0" > > At first i thought it could not find the librxtxParallel.so file, but > when i renamed it i got a different saying it could not find the library. > > I have tried to run as root no difference. > > It is really weird, i get no compile errors and the serial ports work fine. > > I changed the LPRPort.java and commented out the Initialize call method. > And just get the same error but for the method open. > > It is as though it can't see the methods, and yet it can see the library. > I did have a bit of check of the JNI implementation in rxtx but could > not spot anything. > > > You can check if the symbols are in the shared library: nm librxtxSerial.so |grep Initialize If the symbols are not there, there was a build error. Watch very close for build errors while compiling from source. I suspect something isnt behaving right. -- Trent Jarvi tjarvi at qbang.org From allen at adbyrne.us Thu Jun 30 06:55:58 2005 From: allen at adbyrne.us (Allen Byrne) Date: Thu, 30 Jun 2005 07:55:58 -0500 Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> References: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> Message-ID: <200506300755.59159.allen@adbyrne.us> On Thursday 30 June 2005 00:31, rxtx-request at mail.electronpusher.org wrote: > >Message: 8 >Date: Sat, 25 Jun 2005 10:50:24 +0200 >From: Uwe Kubosch >Subject: [Rxtx] RXTX in FC3/FC4 >To: rxtx at mail.electronpusher.org >Message-ID: <1119689424.12606.14.camel at BPC0276> >Content-Type: text/plain > >Hi all! > >I am trying to get RXTX to work on Fedora Core, version 3 or 4. > >I have tried this with both rxtx 2.0 and 2.1. > >I have tried on two different machines. > >I have tried with java 1.4.2 and java 1.5.0, both from Sun. > >I always get a signall 11 from the native libraries when they are >loaded. ?Is this a common problem? ?Any help is greatly appreciated. >Below is the start of the error message. ?More can be supplied on >demand. > >An unexpected exception has been detected in native code outside the VM. >Unexpected Signal : 11 occurred at PC=0x65015A >Function=(null)+0x65015A >Library=/lib/ld-linux.so.2 > I had thi same problem on SUSE9.3 and java 1.5.0. After searching through the archives, I found a patch that required adding a sleep(1000) command in two functions of SerialIO.java. This only was for rxtx2.1, I had no trouble with rxtx2.0. Note, also I had to add the "|1.5*" sequence to the configure.in file to get good *.so libs. Again 2.0 was fine. -- Allen Byrne adbyrne at ieee.org http://modelrr.adbyrne.us From taj at www.linux.org.uk Fri Jun 3 01:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 08:57:29 +0100 (BST) Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 3 09:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 16:57:53 +0100 (BST) Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi at qbang.org From jasmine at electronpusher.org Fri Jun 3 10:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 17:12:21 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 11:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:02:09 +0100 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 11:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:05:10 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From jon.nall at gmail.com Mon Jun 6 09:13:58 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 10:13:58 -0500 Subject: [Rxtx] StackOverflowError Message-ID: I have a fairly small application that is communicating to a microcontroller programmer at 115.2k. I have a test where I try and dump the memory of the microcontroller (whose size is 8k and change). Things are going smoothly and the data looks good. Then after reading out ~6.5k of data, I get a StackOverflowError. The stack trace looks like: CommInterface.serialEvent(): 324 // this is my code RXTXPort.sendEvent(): 732 RXTXPort.eventLoop() [Native] MonitorThread.run(): 1531 I am running on windows and using rxtx-2.1-CVS-20050120. When I increased the stack size to 512k, I could read the entire chip without issue. But that doesn't seem like the right thing to do without root causing what's happening. My code doesn't include any recursion and the stack trace looks terribly short, so I'm a bit confused as to why I'm getting a StackOverflowError. CommInterface.serialEvent() does little more than grab the available bytes, enter a synchronized block, stick them in a common data area for the main thread to use and leave the synchronization block. I guess my question is: are there any known issues with the default stack size when using the latest rxtx on windows? thanks, nall. From taj at www.linux.org.uk Mon Jun 6 09:27:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 16:27:34 +0100 (BST) Subject: [Rxtx] StackOverflowError In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > I have a fairly small application that is communicating to a > microcontroller programmer at 115.2k. I have a test where I try and > dump the memory of the microcontroller (whose size is 8k and change). > Things are going smoothly and the data looks good. Then after reading > out ~6.5k of data, I get a StackOverflowError. The stack trace looks > like: > > CommInterface.serialEvent(): 324 // this is my code > RXTXPort.sendEvent(): 732 > RXTXPort.eventLoop() [Native] > MonitorThread.run(): 1531 > > I am running on windows and using rxtx-2.1-CVS-20050120. When I > increased the stack size to 512k, I could read the entire chip without > issue. But that doesn't seem like the right thing to do without root > causing what's happening. My code doesn't include any recursion and > the stack trace looks terribly short, so I'm a bit confused as to why > I'm getting a StackOverflowError. > > CommInterface.serialEvent() does little more than grab the available > bytes, enter a synchronized block, stick them in a common data area > for the main thread to use and leave the synchronization block. > > I guess my question is: are there any known issues with the default > stack size when using the latest rxtx on windows? > This is the first I've heard of the problem. It is strange as you mention lookin at the stack trace. That cant be taking up too much space. If you just toss the data instead of trying to put it in your work area, does it persist? -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Mon Jun 6 10:09:39 2005 From: lengyel at gmail.com (FL) Date: Mon, 6 Jun 2005 12:09:39 -0400 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on which the jdk1.5.0_03 is installed. I found that the INSTALL documentation seems to be in error. It states that javacomm20-x86.tar.Z (the Java Communications API for Solaris/x86) must be used, in fact this choice led to the following test with theBlackBox sample program in the commapi: root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG BlackBox -p /dev/ttyS0 Port /dev/ttyS0 not found! No serial ports found! Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to cause Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to the Eclipse stable build version 3.1M7 to avoid this. However, I found that using the Solaris/Sparc version of commapi worked on my system. I have documented this on: http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050606/b28fb9a7/attachment-0403.html From taj at www.linux.org.uk Mon Jun 6 10:30:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:30:27 +0100 (BST) Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, FL wrote: > I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on > which the jdk1.5.0_03 is installed. I found that the INSTALL documentation > seems to be in error. It states that javacomm20-x86.tar.Z (the Java > Communications API for Solaris/x86) must be used, in fact this choice led to > the following test with theBlackBox sample program in the commapi: > > root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG > BlackBox -p /dev/ttyS0 > Port /dev/ttyS0 not found! > No serial ports found! > > Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to > cause > Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to > the Eclipse stable build version 3.1M7 to avoid this. > > However, I found that using the Solaris/Sparc version of commapi > worked on my system. > > I have documented this on: > > http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 > Thanks FL. I'll change the documentation to point to the SPARC comm.jar. In the past, any Solaris was good enough, we tried to avoid the w32 comm.jar because it made native calls rxtx would never implement on any OS as they are not platform neutral. I'll withold comments about Sun's comm.jar being different on various CPUs within even the same OS. RXTX 2.1 does not need to do that even acrossed OSs for instance. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 6 10:35:43 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 11:35:43 -0500 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API Message-ID: It seems that Sun's javax.comm site does not include JavaDoc'ed API and the RxTx site has the API, but no real documentation. Is there some site that i'm just missing in my google searches? I'm looking for a copy of the javax.comm API which is documented. Thanks, nall. From taj at www.linux.org.uk Mon Jun 6 10:44:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:44:03 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > It seems that Sun's javax.comm site does not include JavaDoc'ed API > and the RxTx site has the API, but no real documentation. Is there > some site that i'm just missing in my google searches? I'm looking for > a copy of the javax.comm API which is documented. > > Thanks, > nall. Sun's version is with their binary downloads. RXTX tries to match that so I never bothered with more complete JavaDocs. Whatever Sun documents is what we try to do. -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Mon Jun 6 12:13:44 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 6 Jun 2005 14:13:44 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: Message-ID: <20050606181245.528C929D56F@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Trent Jarvi > Sent: Monday, June 06, 2005 12:44 PM > To: Jon Nall; Java RXTX discussion > Subject: Re: [Rxtx] Where can I find JavaDoc on the javax.comm API > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > It seems that Sun's javax.comm site does not include JavaDoc'ed API > > and the RxTx site has the API, but no real documentation. Is there > > some site that i'm just missing in my google searches? I'm > looking for > > a copy of the javax.comm API which is documented. > > > > Thanks, > > nall. > > Sun's version is with their binary downloads. RXTX tries to > match that so I never bothered with more complete JavaDocs. > Whatever Sun documents is what we try to do. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Try http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht ml -Ack From gadelavega at yahoo.com.ar Mon Jun 6 12:58:09 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Mon, 6 Jun 2005 15:58:09 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606181245.528C929D56F@mail.electronpusher.org> Message-ID: <20050606185809.57069.qmail@web14603.mail.yahoo.com> --- "David S. Acker" escribi?: > > -----Original Message----- > > From: rxtx-bounces at mail.electronpusher.org > > [mailto:rxtx-bounces at mail.electronpusher.org] On > Behalf Of Trent Jarvi > > Sent: Monday, June 06, 2005 12:44 PM > > To: Jon Nall; Java RXTX discussion > > Subject: Re: [Rxtx] Where can I find JavaDoc on > the javax.comm API > > > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > > > It seems that Sun's javax.comm site does not > include JavaDoc'ed API > > > and the RxTx site has the API, but no real > documentation. Is there > > > some site that i'm just missing in my google > searches? I'm > > looking for > > > a copy of the javax.comm API which is > documented. > > > > > > Thanks, > > > nall. > > > > Sun's version is with their binary downloads. > RXTX tries to > > match that so I never bothered with more complete > JavaDocs. > > Whatever Sun documents is what we try to do. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > Try > http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > ml > -Ack > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > I'm prety sure it was there... but not anymore. Gonzalo A. de la Vega, BI ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From taj at www.linux.org.uk Mon Jun 6 18:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 01:09:14 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606185809.57069.qmail@web14603.mail.yahoo.com> References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: >> http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > > I'm prety sure it was there... but not anymore. > It is there. Maybe the URL got mangled. Try this http://tinyurl.com/8dfp7 It just redirects you to: http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.html -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 7 05:46:39 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Jun 2005 07:46:39 -0400 Subject: [Rxtx] rxtx under fedora - odd procedures Message-ID: Hi All, I was able to get RXTX communications to work under Fedora, but only after I added myself to the UUCP and LOCK groups, logged out and then logged back in. Both groups appear to be needed in order to access the serial ports. Also the group alter did not take until after I logged out and logged back in. My theory is that you need permission to write to the var/spool directory under fedora and that this is the only way to do it. Logging out and logging back in just seems like an odd thing to do. I suppose some users may have to restart X. Ouch! Is this true? The alter_group command indicates that you need to be an su to alter the group database. Does this mean that my serial port users need a database su able person to use serial port applications under RXTX? If so, what is the procedure to make a transparent install work using Java web start? Should I be prompting users for the su password? Should I be telling users to exit from X and log out? Is this the way other serial communications programs work? Thanks! - Doug From sean_montgomery at baseview.com Tue Jun 7 08:14:51 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 7 Jun 2005 10:14:51 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: >>> http://java.sun.com/products/javacomm/javadocs/javax/comm/package- >>> summary.ht >>> > > >> >> I'm prety sure it was there... but not anymore. >> >> > > It is there. Maybe the URL got mangled. Try this > > http://tinyurl.com/8dfp7 > > It just redirects you to: > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > summary.html > Maybe the issue here is that the info is available without frames from that URL, but when you try to access it with frames (from the link on that page) it doesn't work - it takes you to: http://java.sun.com/products/javacomm/javadocs/index.html Which doesn't have anything useful on it. From gadelavega at yahoo.com.ar Tue Jun 7 08:22:50 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:22:50 -0300 (ART) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: Message-ID: <20050607142251.92850.qmail@web14626.mail.yahoo.com> --- "Dr. Douglas Lyon" escribi?: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the > group > alter did not take until after I logged out and > logged back in. > > My theory is that you need permission to write to > the var/spool > directory under fedora and that this is the only way > to do it. > > Logging out and logging back in just seems like an > odd thing to > do. I suppose some users may have to restart X. > Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port > applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log > out? > Is this the way other serial communications programs > work? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Actually, you need the lock group to acces /var/lock directory, and uucp to acces /dev/ttyS*. You (as root) shuold add all users you will allow to use the serial ports to group uucp and all the ones you'll allow to lock the ports to lock group (rxtx needs both). This is not only for rxtx, but for any use of the serial ports. Next time they login they'll be able to work, so if they are in they'll have to log out first. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From gadelavega at yahoo.com.ar Tue Jun 7 08:23:56 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:23:56 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> Message-ID: <20050607142356.93815.qmail@web14624.mail.yahoo.com> --- Sean Montgomery escribi?: > > On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: > > >>> > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > >>> summary.ht > >>> > > > > > >> > >> I'm prety sure it was there... but not anymore. > >> > >> > > > > It is there. Maybe the URL got mangled. Try this > > > > http://tinyurl.com/8dfp7 > > > > It just redirects you to: > > > > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > > summary.html > > > > Maybe the issue here is that the info is available > without frames > from that URL, but when you try to access it with > frames (from the > link on that page) it doesn't work - it takes you > to: > > http://java.sun.com/products/javacomm/javadocs/index.html > > Which doesn't have anything useful on it. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > That's right, my bad. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From jon.nall at gmail.com Tue Jun 7 08:33:40 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 09:33:40 -0500 Subject: [Rxtx] performance expectations Message-ID: Hi all. I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC microcontroller. The protocol I'm using (which I didn't create) looks like this for the section of code I'm concerned with: PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data PIC -> PC: 0x01 // ACK 0xNN // First 8 bits of data 0xMM // Second 8 bits of data I issue ~2000 of these Read commands. The PIC itself has an input fifo which can store 18 bytes, so I can have 18 read commands in flight at a given time. The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k 8N1. I am measuring the time it takes to perform these 2000 commands at around 30 seconds, which is much longer than I anticipated. With the link fully utilized, I expected: Time per byte transmitted: 115200 / 8 = 14400 bytes/second = ~70 uS/byte Time per response transmitted: ~70 uS/byte * 3 bytes/response = ~210 uS/response Time for 2000 responses to be transmitted: ~210 uS/response * 2000 responses = ~420ms I'm a bit new to this, so I may have made some bad asumptions, but I would have expected a time of a couple of seconds to perform the 2000 reads, not 30+ seconds. I'm obviously missing something here. Can someone help me understand what's going on? Thanks, nall. From taj at www.linux.org.uk Tue Jun 7 09:17:48 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:17:48 +0100 (BST) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the group > alter did not take until after I logged out and logged back in. > > My theory is that you need permission to write to the var/spool > directory under fedora and that this is the only way to do it. > > Logging out and logging back in just seems like an odd thing to > do. I suppose some users may have to restart X. Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log out? > Is this the way other serial communications programs work? > RIght now, rxtx requires you do one of two things. 1) Use lock files (recommended). This requires intervention by the root users to allow users to create lock files and open the ports as you note. 2) configure rxtx with --disable-lockfiles. In this case you need only worry about the permissions on /dev/ttyS* I'm not sure what the default on Fedora is with respect to permisions. This is not very attractive. There is a better way it could be done on Fedora. Fedora comes with lockdev library. I've been considering this for some time. We could use that for the locking and do away with many of the problems. The problem is embeded devices running Linux do not come with liblockdev. But for your use, I would consider adding a new option for locking serial devices using liblockdev. lockdev-devel has a man page with further information. SYNOPSIS #include pid_t dev_testlock( const char * devname); pid_t dev_lock( const char * devname); pid_t dev_relock( const char * devname, pid_t pid); pid_t dev_unlock( const char * devname, pid_t pid); cc [ flag ... ] file ... -llockdev [ library ] This would probably need to be a configure time option to prevent problems on embeded Linux devices but could otherwise be the default on Linux. I could toss a quick patch together if this is confusing. It is actually easier than what rxtx does now. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 09:27:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:27:11 +0100 (BST) Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > Hi all. > I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC > microcontroller. The protocol I'm using (which I didn't create) looks like this > for the section of code I'm concerned with: > > PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data > PIC -> PC: 0x01 // ACK > 0xNN // First 8 bits of data > 0xMM // Second 8 bits of data > > I issue ~2000 of these Read commands. The PIC itself has an input fifo which > can store 18 bytes, so I can have 18 read commands in flight at a given time. > The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k > 8N1. > > I am measuring the time it takes to perform these 2000 commands at around 30 > seconds, which is much longer than I anticipated. With the link fully utilized, > I expected: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte > > Time per response transmitted: > ~70 uS/byte * 3 bytes/response = ~210 uS/response > > Time for 2000 responses to be transmitted: > ~210 uS/response * 2000 responses = ~420ms > > I'm a bit new to this, so I may have made some bad asumptions, but I would have > expected a time of a couple of seconds to perform the 2000 reads, not 30+ > seconds. > > I'm obviously missing something here. Can someone help me understand what's > going on? > I've hooked rxtx in loopback with a scope in the past at 9600 baud (baud rate is not important). Using event notification and just writing a byte on event/read the latencey was around 8-12 ms. The JNI is not an efficient way to use native code - especially for bit banging. So if timing is critical you want to move some of the logic into the native code rather than banging over the JNI. 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your performance. C# has advantages here. If you move your logic into the native layer or use gcj (rxtx will work with that too) most of your latency should vanish. You may have to play with some sleeps in eventLoop at that point to get full native efficiency. With gcj all of rxtx becomes 'native code' as java is just treated as a subset of C++. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 09:38:51 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 10:38:51 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: On 6/7/05, Jon Nall wrote: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte of course that should be divided by 10 to account for the start/stop bits, but it barely changes the end results. From carobizar at free.fr Tue Jun 7 10:21:29 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 7 Jun 2005 18:21:29 +0200 Subject: [Rxtx] (no subject) Message-ID: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Hello ! I am a french student and I have to create an application able to read and write on serial and parallel port and to run on Windows and Linux. For the moment my program run on Windows thanks the Java Communication API (version for Microsoft Windows and Solaris/x86). But it doesn't work on Linux. Does a recent version of an installation documentation exist ? I didn't find one on the RXTX site (nothing for the windows installation and the linux installation deals with a "jcl.jar" that I don't know...). So, I have some questions : 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 version or Linux&w32 version ?) What are the differences between them ? Which of them are the most stable ? 2) Where have I to put the .so and .dll files ? 3) What have I to write on the file javax.comm.properties ? 4) Have I to delete the file win32comm.dll included in the Java Comm API ? 5) Have I to keep both comm.jar and RXTXcomm.jar ? Best regards, Caroline. From debief at telemsa.com Tue Jun 7 10:44:56 2005 From: debief at telemsa.com (DEBIEF Eric) Date: Tue, 7 Jun 2005 18:44:56 +0200 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: <200506071844.56656.debief@telemsa.com> Hi, We are "pushing" RxTx /Java here in a half-duplex link. The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC and application handling) about 25?s/byte. The figures are the barely the same on two environments. Environment 1 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Linux 2.6.3, Mdk 10.0. RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : bytes are lost on the wire. I need to investigate this mystery.... Java : 1.4.2-rc1 Blackdown Environment 2 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Windows 2000 Pro RxTx : 2.0.7. Java : 1.4.2_08 SUN I Hope this help, Eric. _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 7 11:05:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:05:45 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, DEBIEF Eric wrote: > Hi, > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. How many write() calls is this? > > Environment 1 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Linux 2.6.3, Mdk 10.0. > RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : > bytes are lost on the wire. I need to investigate this mystery.... > Java : 1.4.2-rc1 Blackdown > > Environment 2 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Windows 2000 Pro > RxTx : 2.0.7. > Java : 1.4.2_08 SUN > In my event/read/write test I found windows was ~20% faster than linux for some reason (strange part is Windows was in VMWare on the same Linux machine). It was about the same rxtx version. There are many problems with rxtx 1.4 with respect to commapi on windows but its code paths are more simple. What some people want from rxtx is perhaps better served by hacking up the very first release as they just want to read and write which is what rxtx was before Sun released commapi. It sounds like perhaps you are pushing out larger writes which will greatly improve results. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 11:16:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:16:49 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118161289.42a5c989cf6a2@imp4-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: On Tue, 7 Jun 2005 carobizar at free.fr wrote: > > Hello ! > > I am a french student and I have to create an application able to read and write > on serial and parallel port and to run on Windows and Linux. > For the moment my program run on Windows thanks the Java Communication API > (version for Microsoft Windows and Solaris/x86). > But it doesn't work on Linux. > > Does a recent version of an installation documentation exist ? > I didn't find one on the RXTX site (nothing for the windows installation and the > linux installation deals with a "jcl.jar" that I don't know...). > > So, I have some questions : > > 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 > version or Linux&w32 version ?) What are the differences between them ? Which > of them are the most stable ? > Use rxtx 2.0 with commapi for sparc solaris from Sun. If you want your current package javax.comm. > 2) Where have I to put the .so and .dll files ? On Linux just use the source, the configure script will do all of that for you. tar -xzvf rxtx-2.0-version mkdir rxtx-2.0-version/build cd rxtx-2.0-version/build ../configure && make install It will do everything for you. With Windows, you need to create the javax.comm.properties and install the DLL on your path. But you can just use Sun's package too. They are intended to be interchangable. > > 3) What have I to write on the file javax.comm.properties ? Driver=gnu.io.RXTXCommDriver More documentation in INSTALL that comes with the source. Sun's documentation should work too. configure does this for you on Linux. > > 4) Have I to delete the file win32comm.dll included in the Java Comm API ? > No > 5) Have I to keep both comm.jar and RXTXcomm.jar ? > Yes. RXTX 2.1 replaces comm.jar but the package is different (gnu.io) to avoid contaminating Sun's namespace. With rxtx 2.0 you need Sun's comm.jar - they work together. > > Best regards, > Caroline. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Tue Jun 7 12:07:34 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 14:07:34 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 Message-ID: <20050607180632.1543A29D5C8@mail.electronpusher.org> Hello, I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our product includes a built in USB to Serial adapter so that when it is connected to your PC over USB, it appears as a serial port. We had problems with Sun's comm library because it did not detect serial ports coming and going properly. I did run into a few issues with RxTx though. I am building under Windows (we support XP and 2000) under cygwin. I used a simple make file for the c code that works under cygwin and ant to build the java stuff. Attached is a diff file. The patches hit the following issues: ParallelImp.c - I am not using config so there is no config.h for me. Also, gcc didn't like a local file (win32termios.h) getting included with <> . RXTXPort.java - You can get an exception during the writeByte, writeArray, nativeDrain, readByte, read, readArray, readTerminatedArray, and nativeAvailable calls. Without this patch the IOLocked count gets stuck incremented. termios.c - If you try to open a port through CreateFile and get ERROR_ACCESS_DENIED it means someone else is using the port. We need to make sure to use serial_close instead of just close. I found that some devices finish their I/O synchronously. The code was treating this as an error. I also added some checking on the ClearError calls. I found a compile error when debugging is turned on (see the usleep change). SerialImp.c - Again, I don't have a config.h and again we must use quotes and not <> to include win32termios.h . I also commented out a report call since it seems to happen constantly on my system. Feel free to use these in any way that you want or just to ignore them. Thanks! -Dave Acker dacker at nomadio.net Software Engineer Nomadio, Inc. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diffs.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/5671d159/diffs-0400.txt From jon.nall at gmail.com Tue Jun 7 12:28:16 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 13:28:16 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, DEBIEF Eric wrote: > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. Hi. This is helpful, thanks. I can think of 2 reasons I'm not collecting the data as fast as I think I should be: 1) the device to PC connection is not at 100% utilization 2) my SerialPortEventListener processing has too much overhead Are there other explanations I might be missing as to why it takes so long to transfer the data? Thanks. nall. From taj at www.linux.org.uk Tue Jun 7 13:21:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:21:46 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > On 6/7/05, DEBIEF Eric wrote: > > We are "pushing" RxTx /Java here in a half-duplex link. > > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > > and application handling) about 25?s/byte. > > The figures are the barely the same on two environments. > > Hi. > This is helpful, thanks. I can think of 2 reasons I'm not collecting > the data as fast as I think I should be: > 1) the device to PC connection is not at 100% utilization > 2) my SerialPortEventListener processing has too much overhead > > Are there other explanations I might be missing as to why it takes so > long to transfer the data? > Polling the port would probably make more sense. You can set the threshold/timeouts to avoid racing and not deal with the event notification. As mentioned earlier I think the event latency is ~10ms. Keep the event listener around, rxtx 2.* does not close well without it. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 13:27:27 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 14:27:27 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, Trent Jarvi wrote: > Polling the port would probably make more sense. You can set the > threshold/timeouts to avoid racing and not deal with the event > notification. As mentioned earlier I think the event latency is ~10ms. Trent, Thanks for the response. Just to make sure I understand what you're talking about, when you say event latency, do you mean the time it takes from when the byte hits the PC's comm port to when rxtx presents it to user code? So if the link is 100% utilized, will my user code see "hiccups" or a steady stream of data? Thanks for helping a serial port newbie. nall. From dacker at nomadio.net Tue Jun 7 13:32:20 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 15:32:20 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <20050607193118.5499329CAA0@mail.electronpusher.org> Some folks asked about the make file and ant steps. I have JAVA_HOME set as follows: $ echo $JAVA_HOME C:\Program Files\Java\jdk1.5.0_01 I have all the code in rxtx/src put into gnu/io . The make file here doesn't have optimizations turned on. We have not tested with it yet. --------------Begin Makefile------------------ CPPFLAGS="-I$(JAVA_HOME)/include" "-I$(JAVA_HOME)/include/win32" SOBJECTS=SerialImp.o fuserImp.o termios.o fixup.o init.o POBJECTS=ParallelImp.o termios.o init.o DLLS=rxtxParallel.dll rxtxSerial.dll all: $(CLASSES) $(DLLS) rxtxSerial.dll: $(SOBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(SOBJECTS) rxtxParallel.dll: $(POBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(POBJECTS) clean: rm -fv $(SOBJECTS) $(POBJECTS) $(DLLS) %.o: %.c gcc -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< %.o: %.cpp g++ -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< --------------End Makefile------------------ Here is the ant target I use to build the rxtx libs. Our build puts the class files in a bin dir. We copy the dlls to a deploy dir and to the build dir. Eclipse seems to like the dlls in the build dir. The deploy dir is used when we build our full package. --------------Begin Ant Section------------------ --------------End Ant Section------------------ > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > David S. Acker > Sent: Tuesday, June 07, 2005 2:08 PM > To: 'Java RXTX discussion' > Subject: [Rxtx] Patches to 2.1-7pre17 > > Hello, > I am using RxTx with the Nomadio Sensor, > http://www.nomadio.net/ . Our product includes a built in > USB to Serial adapter so that when it is connected to your PC > over USB, it appears as a serial port. We had problems with > Sun's comm library because it did not detect serial ports > coming and going properly. > > I did run into a few issues with RxTx though. I am building > under Windows (we support XP and 2000) under cygwin. I used > a simple make file for the c code that works under cygwin and > ant to build the java stuff. Attached is a diff file. The > patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h > for me. Also, gcc didn't like a local file (win32termios.h) > getting included with <> . > > RXTXPort.java - You can get an exception during the > writeByte, writeArray, nativeDrain, readByte, read, > readArray, readTerminatedArray, and nativeAvailable calls. > Without this patch the IOLocked count gets stuck incremented. > > termios.c - If you try to open a port through CreateFile and > get ERROR_ACCESS_DENIED it means someone else is using the > port. We need to make sure to use serial_close instead of > just close. I found that some devices finish their I/O > synchronously. The code was treating this as an error. I > also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we > must use quotes and not <> to include win32termios.h . I > also commented out a report call since it seems to happen > constantly on my system. > > Feel free to use these in any way that you want or just to > ignore them. > Thanks! > > -Dave Acker > dacker at nomadio.net > Software Engineer > Nomadio, Inc. > From taj at www.linux.org.uk Tue Jun 7 13:37:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:37:45 +0100 (BST) Subject: [Rxtx] Re: Stack Smashing Attack In-Reply-To: <200506072012.48860.ferdinand.tatzig@web.de> References: <200506072012.48860.ferdinand.tatzig@web.de> Message-ID: On Tue, 7 Jun 2005, Ferdinand Tatzig wrote: > Dear Trent > > I am using RXTX for serial port communication between a PC and a payment > transaction terminal. > When I run my application under Windows 2000, an i386-Linux or an i386-FreeBSD > it works as I expect it to do. However, when I start it to run on AMD64 > machine with a 64-bit Gentoo Linux, the VM terminates with the following > error: > > Port found: /dev/ttyS0 > java: stack smashing attack in function configure_port() > > I am using a 64-bit Blackdown-1.4.2-01 VM. > > I have searched the internet but have found no information about this error. > > This is the code of the method which initializes the serial port: > > /** > * initializes a serial port for communication with a terminal; only > * accessible within this class > * > * @param communication > * @param serialPortToBeInitialized > * @param tillInterfaceEventListener > */ > private TillInterfaceSerialPort(Communication communication, > String serialPortToBeInitialized, > TillInterfaceEventListener tillInterfaceEventListener) > throws IOException, PortInUseException, > TillInterfaceSerialPortNotFoundException, > TooManyListenersException, UnsupportedCommOperationException { > serialPortName = "not initialized yet"; > CommPortIdentifier portId = null; > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > boolean portFound = false; > String temporarySerialPortName = "not initialized yet"; > > // look for a serial port > while (portList.hasMoreElements() && !portFound) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > temporarySerialPortName = portId.getName(); > if (temporarySerialPortName.equals(serialPortToBeInitialized)) { > System.out.print("Port found: "); > System.out.println(temporarySerialPortName); > serialPortName = temporarySerialPortName; > portFound = true; > } > } > } > if (portFound) { > > // initialize the found port - this command causes the VM to terminate > serialPort = (SerialPort) portId > .open( > TillInterfaceConstants.APPLICATION_NAME, > TillInterfaceConstants > .TIMEOUT_IN_MILLISECONDS_FOR_OPENING_OF_COMMUNICATION_PORT); > > // add an event listener which listens > // on the serial port and notifies the > // serial port object when input bytes > // have been received at the port > serialPort.addEventListener(tillInterfaceEventListener); > serialPort.notifyOnDataAvailable(true); > > // initialize the physical layer > // parameters of the serial port > serialPort.setSerialPortParams(TillInterfaceConstants.BAUD_RATE, > SerialPort.DATABITS_8, SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > // set the inter-character > // timeout (T2) > serialPort > .enableReceiveTimeout(TillInterfaceConstants.INTERCHARACTER_TIMEOUT_IN_MILLISECONDS); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > } else > throw new TillInterfaceSerialPortNotFoundException(); > } > > Any hint to solve this problem would be kindly appreciated. > The only thing that comes to mind here after looking at the offending function is rxtx used to include asm/termios.h but now we moved to termios.h and had glibc fix their headers. The asm/termios.h caused problems as its termios was smaller than the actual termios. This should be fixed in current rxtx versions but you can just glance at SerialImp.c and make sure it does not include asm/termios.h. I've cc'd the rxtx mail list because there was one other mention of stack problems recently. I have used rxtx on opteron systems with success. I have a bug I'm trying hard to reproduce on suse 64 bit (circa linux 2.4.19) systems though. So far I have not been able to reproduce the bug. That said, with gentoo... I like gentoo but I seriously doubt they do any QA with their kernel and Java. I've seen problems before. If you use gentoo and have Java problems, at least stick to Linus (that is an s there) kernels while using Java. I'm not an expert on gentoo but I've seen patches go into experimental kernels that turn out to break java and are reverted before going to Linus just before I see problems with gentoo on this list. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:16:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:16:14 +0100 (BST) Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: On Tue, 7 Jun 2005, David S. Acker wrote: > Hello, > I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our > product includes a built in USB to Serial adapter so that when it is > connected to your PC over USB, it appears as a serial port. We had problems > with Sun's comm library because it did not detect serial ports coming and > going properly. > > I did run into a few issues with RxTx though. I am building under Windows > (we support XP and 2000) under cygwin. I used a simple make file for the c > code that works under cygwin and ant to build the java stuff. Attached is a > diff file. The patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h for me. Also, > gcc didn't like a local file (win32termios.h) getting included with <> . > > RXTXPort.java - You can get an exception during the writeByte, writeArray, > nativeDrain, readByte, read, readArray, readTerminatedArray, and > nativeAvailable calls. Without this patch the IOLocked count gets stuck > incremented. > > termios.c - If you try to open a port through CreateFile and get > ERROR_ACCESS_DENIED it means someone else is using the port. We need to > make sure to use serial_close instead of just close. I found that some > devices finish their I/O synchronously. The code was treating this as an > error. I also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we must use quotes > and not <> to include win32termios.h . I also commented out a report call > since it seems to happen constantly on my system. > > Feel free to use these in any way that you want or just to ignore them. > Thanks! > Hi Dave These patches look great as is. Thanks. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:33:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:33:16 +0100 (BST) Subject: [Rxtx] Patch to IOLocked (fwd) Message-ID: This appears to be another solution to the locking. Chris, the other option just moves the locking into the finally clause which I think would be a little cleaner though I'm posting this patch to so people can comment. -- Trent Jarvi tjarvi at qbang.org ---------- Forwarded message ---------- Date: Wed, 1 Jun 2005 13:01:32 +0100 From: Christopher Dawes To: taj at www.linux.org.uk Subject: Patch to IOLocked Do you want me to check it out of CVS and then submit changes? Christopher -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXPort.java.diff Type: application/octet-stream Size: 6965 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/c442f9fc/RXTXPort.java-0403.obj From Christopher.Dawes at retail-logic.com Wed Jun 8 00:57:24 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 8 Jun 2005 07:57:24 +0100 Subject: [Rxtx] Patch to IOLocked (fwd) [Virus Checked] In-Reply-To: Message-ID: Agreed, much better Java :-) Thanks Christopher ------------------------------------------- Consultant Engineer Retail Logic Limited Fleet GU51 3TZ Tel: +44 (0)1252 644377 Mob: +44 (0)7899 842759 Fax: +44 (0)1252 776708 rxtx-bounces at mail.electronpusher.org wrote on 07/06/2005 21:33:16: > > This appears to be another solution to the locking. Chris, the other > option just moves the locking into the finally clause which I think would > be a little cleaner though I'm posting this patch to so people can > comment. > > -- > Trent Jarvi > tjarvi at qbang.org > > ---------- Forwarded message ---------- > Date: Wed, 1 Jun 2005 13:01:32 +0100 > From: Christopher Dawes > To: taj at www.linux.org.uk > Subject: Patch to IOLocked > > Do you want me to check it out of CVS and then submit changes? > > Christopher[attachment "RXTXPort.java.diff" deleted by Chris > Dawes/Retaillogic/NISABA] _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx From zempftman at gmail.com Wed Jun 8 07:57:25 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 09:57:25 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Maxwell Zempftman Date: May 27, 2005 5:01 PM Subject: Re: [Rxtx] Kaffe & rxtx & armv5b To: rxtx at mail.linuxgrrls.org Here are the results from working this week: The "NullPointerExceptions" are generated by the software when I choose a bad device file. I discovered that this occurs on the i686-RedHat box as well. This exception seems to be generated only by this particular application, and not by the example programs in contrib. So, for example: java MyApp /dev/null <-- generates NullPointerException java MyApp fake <-- generates NullPointerException java MyApp /dev/ttyS0 <-- does not generate NullPointerException Using the program CommCheck (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it appears as though /dev/ttyS0 is the only valid serial device file on the XScale device, so the errors I was getting are not really be bugs. Although /dev/ttyS0 did not generate NullPointerExceptions, I did encounter this error: --start java MyApp /dev/ttyS0 (going mostly from memory, not exact) PortList.hasMoreElements: true Listening on: /dev/ttyS0 Client connected. >From net: echo kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 vmExcept_setJNIFrame Assert: on 'fp != 0' failed. --end I took a look at exception.h, and it seems as though the problematic code does not exist in newer versions of Kaffe (I have been using CVS-2004-11). Next week I will try to use a newer version, although so far everything but CVS-2004-11 has failed. Also, I the device files I need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with something like this? Thanks, Max. > On 5/21/05, Trent Jarvi wrote: > > I'm not sure what is wrong in the first part. It sounds like your > > application may be swallowing an exception while trying to enumerate the > > port or open it. The usual mistake made it not having permissions to > > either open the port or create the lockfile. There should be examples in > > the contrib directory you can try that enumerate and open ports. Maybe > > that will give you some hints. > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > Sun's code limiting you there though you do need to compile and install > > rxtx for the XScale with Sun's Commapi. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > From taj at www.linux.org.uk Wed Jun 8 08:22:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 15:22:44 +0100 (BST) Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > ---------- Forwarded message ---------- > From: Maxwell Zempftman > Date: May 27, 2005 5:01 PM > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > To: rxtx at mail.linuxgrrls.org > > > Here are the results from working this week: > > The "NullPointerExceptions" are generated by the software when I > choose a bad device file. I discovered that this occurs on the > i686-RedHat box as well. This exception seems to be generated only by > this particular application, and not by the example programs in > contrib. So, for example: > > java MyApp /dev/null <-- generates NullPointerException > java MyApp fake <-- generates NullPointerException > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > Using the program CommCheck > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > appears as though /dev/ttyS0 is the only valid serial device file on > the XScale device, so the errors I was getting are not really be bugs. > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > encounter this error: > > --start > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > PortList.hasMoreElements: true > Listening on: /dev/ttyS0 > Client connected. > >From net: echo > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > --end > > I took a look at exception.h, and it seems as though the problematic > code does not exist in newer versions of Kaffe (I have been using > CVS-2004-11). Next week I will try to use a newer version, although so > far everything but CVS-2004-11 has failed. Also, I the device files I > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > something like this? > In RXTXCommDriver, just look for the following code and add /dev/ttyM to the list. Moxa? if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } So: if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyM", // for Moxa ports "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } Linux just has way too many port types to try enumerating them all. There is potential we can add them back in with udev now. > Thanks, > Max. > > > On 5/21/05, Trent Jarvi wrote: > > > I'm not sure what is wrong in the first part. It sounds like your > > > application may be swallowing an exception while trying to enumerate the > > > port or open it. The usual mistake made it not having permissions to > > > either open the port or create the lockfile. There should be examples in > > > the contrib directory you can try that enumerate and open ports. Maybe > > > that will give you some hints. > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > Sun's code limiting you there though you do need to compile and install > > > rxtx for the XScale with Sun's Commapi. > > > > > > -- > > > Trent Jarvi > > > tjarvi at qbang.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Wed Jun 8 12:16:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 08 Jun 2005 13:16:03 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A60B8D.8080500@cs.umn.edu> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> Message-ID: <42A735E3.8040706@atcorp.com> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual serial comport. This isn't so much of a problem, what is, however, is that the comport does not appear to be able to be set to any arbitrary speed, only those from the data_rate enum. I've not found much on using different speeds, has anyone else encountered anything similar? I greatly appreciate any and all comments and suggestions. Thanks in advance, ~ Shawn Lavelle From zempftman at gmail.com Wed Jun 8 12:50:58 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 14:50:58 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: Thanks Trent! That will solve one of the problems. I don't know when my next chance to work on it will be, but I still need to figure out the error I got when I tried opening '/dev/ttyS0' on the Moxa device regarding a failed assertion, seemed to be a Kaffe issue. Thanks for you help, hope to have results soon, Max Englander. On 6/8/05, Trent Jarvi wrote: > On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > > > ---------- Forwarded message ---------- > > From: Maxwell Zempftman > > Date: May 27, 2005 5:01 PM > > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > > To: rxtx at mail.linuxgrrls.org > > > > > > Here are the results from working this week: > > > > The "NullPointerExceptions" are generated by the software when I > > choose a bad device file. I discovered that this occurs on the > > i686-RedHat box as well. This exception seems to be generated only by > > this particular application, and not by the example programs in > > contrib. So, for example: > > > > java MyApp /dev/null <-- generates NullPointerException > > java MyApp fake <-- generates NullPointerException > > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > > > Using the program CommCheck > > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > > appears as though /dev/ttyS0 is the only valid serial device file on > > the XScale device, so the errors I was getting are not really be bugs. > > > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > > encounter this error: > > > > --start > > > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > > > PortList.hasMoreElements: true > > Listening on: /dev/ttyS0 > > Client connected. > > >From net: echo > > > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > > > --end > > > > I took a look at exception.h, and it seems as though the problematic > > code does not exist in newer versions of Kaffe (I have been using > > CVS-2004-11). Next week I will try to use a newer version, although so > > far everything but CVS-2004-11 has failed. Also, I the device files I > > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > > something like this? > > > > > In RXTXCommDriver, just look for the following code and add /dev/ttyM to > the list. Moxa? > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > So: > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyM", // for Moxa ports > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > Linux just has way too many port types to try enumerating them all. There > is potential we can add them back in with udev now. > > > > > Thanks, > > Max. > > > > > On 5/21/05, Trent Jarvi wrote: > > > > I'm not sure what is wrong in the first part. It sounds like your > > > > application may be swallowing an exception while trying to enumerate the > > > > port or open it. The usual mistake made it not having permissions to > > > > either open the port or create the lockfile. There should be examples in > > > > the contrib directory you can try that enumerate and open ports. Maybe > > > > that will give you some hints. > > > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > > Sun's code limiting you there though you do need to compile and install > > > > rxtx for the XScale with Sun's Commapi. > > > > > > > > -- > > > > Trent Jarvi > > > > tjarvi at qbang.org > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- > Trent Jarvi > tjarvi at qbang.org > From taj at www.linux.org.uk Wed Jun 8 12:53:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 19:53:10 +0100 (BST) Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A735E3.8040706@atcorp.com> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: On Wed, 8 Jun 2005, Shawn Lavelle wrote: > Hello, > I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate > with a virtual serial comport. This isn't so much of a problem, what > is, however, is that the comport does not appear to be able to be set to > any arbitrary speed, only those from the data_rate enum. I've not found > much on using different speeds, has anyone else encountered anything > similar? I greatly appreciate any and all comments and suggestions. > This problem is a bit more tricky than it should be. POSIX systems just have a few specified baud rates. Solaris is one of these systems. CommAPI baud rates probably came from someone looking at Solaris. RXTX tries to be POSIX like. W32 is treated as a POSIX like system via a termios.c file in rxtx. Serial ports have baudbase and divisor. So you can set these to come close to the baudrate you want. Some funky equipment like automobile test equipment use baud rates that are not really possible with PC hardware. But if you get as close as possible by changing baud base and divisor, it works. Windows can actually do this for you. I don't know exactly what their code does but if you pass a baudrate to windows, it will guestimate a baudbase and divisor. So you just pass it 10200 baud and it does its job. This is not of very much use the way rxtx does things though. Linux has the standard POSIX like baud rates but if you set the baud rate to B38400, you can set your own baud base and divisor. This is not POSIX that I know of. W32 has more capability than POSIX like systems too. So I did some work to have windows work like Linux via termios.c But the code is not quit right. SerialImp.c and termios.c need some work so all the various buadrates work on Linux and W32. Most other systems will not work beyond what CommAPI already specifies without writting kernel drivers. This is on my todo list but if someone gets to it first, all the better. -- Trent Jarvi tjarvi at qbang.org From carobizar at free.fr Thu Jun 9 06:39:10 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Thu, 9 Jun 2005 14:39:10 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: <1118320750.42a8386e6d3ce@imp5-q.free.fr> Hi ! Thank you for all your advices. I managed to use rxtx on Windows but I have still some difficulties on Linux. I have yet follow your instructions and the configure file has created : - librxtxSerial.so and librxtxParallel.so in the directory /usr/java/j2sdk1.4.2_08/jre/lib/i386 - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the directory /usr/java/j2sdk1.4.2_08/jre/lib - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext But when I run my program, Some exceptions occur : Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver So, 1) What have I forgotten ? 2) Is it possible to make my application run on Linux without the jdk (only the jre) ? Best regards, Caroline. From taj at www.linux.org.uk Thu Jun 9 07:28:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 9 Jun 2005 14:28:05 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118320750.42a8386e6d3ce@imp5-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: On Thu, 9 Jun 2005 carobizar at free.fr wrote: > Hi ! > Thank you for all your advices. > I managed to use rxtx on Windows but I have still some difficulties on Linux. > I have yet follow your instructions and the configure file has created : > - librxtxSerial.so and librxtxParallel.so in the directory > /usr/java/j2sdk1.4.2_08/jre/lib/i386 > - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the > directory /usr/java/j2sdk1.4.2_08/jre/lib > - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext > > But when I run my program, Some exceptions occur : > Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while > loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > com.sun.comm.SolarisDriver > > So, > 1) What have I forgotten ? > The native (.so) libraries are not installed in a directory the JRE is looking for native libraries in. You may look around and see where the .so libraries are in the JRE. I don't know that the jre/lib/i386 directory is specified as a required directory for JREs. I noticed some do not use it. You may try printing the java.libarary.path to see your options. It is also possible to alter the java.library.path. > 2) Is it possible to make my application run on Linux without the jdk (only the > jre) ? Yes. Though installation from source with the JDK is less error prone. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0400.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 7 15:03:09 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 07 Jun 2005 16:03:09 -0500 Subject: [Rxtx] Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <42A60B8D.8080500@cs.umn.edu> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual comport. This isn't so much of a problem, what is, however, is that the comport is only ever set to 9600 baud. I've not found this as a documented bug, has anyone else encountered anything similar? I'll try and provide more detail tomorrow, but if anyone has any suggestions or encountered this before, I'd like to hear about it. Thanks in advance, ~ Shawn Lavelle From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0403.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0403.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0403.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Mon Jun 20 01:04:40 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 20 Jun 2005 08:04:40 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: <42B66A88.4060806@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050620/9be208a1/attachment-0403.html From fbalzarro at libero.it Mon Jun 20 02:33:52 2005 From: fbalzarro at libero.it (Fabio Balzarro) Date: Mon, 20 Jun 2005 10:33:52 +0200 Subject: [Rxtx] RXTXPort:close detected bad file descriptor Message-ID: I'm using RXTX libraries on IPAQ 4150 PDA with Windows CE 4.20 and Jeode. When I close a serial port with sp.close() (where sp is a SerialPort) sometimes an error occour 1119256168085: RXTXPort:close detected bad file descriptor What can I do? Thanks Fabio ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From slavelle at atcorp.com Mon Jun 20 08:08:19 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 20 Jun 2005 09:08:19 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: <42B6CDD3.4040409@atcorp.com> It turns out that I did have a driver-not-used issue which has now been resolved and I can use RxTx on it (had to add ttyUSB as a valid port), but only at standard baud rates. Does USB have the same restrictions on port speed as regular RS232? ~ Shawn Trent Jarvi wrote: > Just a note here. > > I have requested a FTDI usb device and they offered to send one for the > purpose of trying to get rxtx working. I have no idea how long that takes > though. > > > On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > > >>I'm afraid we're just using the latest version from the FTDI website. I've >>not yet played with linux properly with this and unfortunately I run gentoo >>and haven't yet successfully compiled in the ftdi driver. I'll let you know >>if I get any success. >> >>Appologies >> >>Christopher >> >>-----Original Message----- >>From: rxtx-bounces at mail.electronpusher.org >>[mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle >>Sent: 15 June 2005 00:00 >>To: Java RXTX discussion >>Subject: Re: [Rxtx] Virtual Com Ports >> >>Hmm, the latter sounds like a lot of work. It does find the virtual comport >>in windows, i must have just missed it earlier (sign of a long day). On the >>linux side, I suspect that something is not correct with the driver >>installation becuase it does not give me a tty for it :( >> >>Christopher, May I ask what driver you are using for your FTDI chip? >>Did you ever encounter problems with not getting a tty assigned for it? >> >> >> Thanks for all your help! >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>They will have to show up as a tty device in Linux. Probably ttyUSB? >>>That will need an entry in RXTXCommDriver.java. If they dont show up >>>as a tty device, rxtx cant treat it like a serial port. It just wont >> >>work. >> >>>With COM3, rxtx will try to open the port and perform a timed out read. >>>Usually if a port is not there, the read blows up or the open blows up. >>>Timing out is fine. COM3 used to share interrupts with COM1. I know >>>you can reassign ports in XP. RXTX scans up through COM255. You may >>>try moving it. >>> >>> >>>The code in question is the following in RXTXCommDriver.java >>> >>> >>> if(osName.equals("Linux")) >>> { >>> String[] Temp = { >>> "ttyS", // linux Serial Ports >>> "ttySA", // for the IPAQs >>> "ttyUSB" // for USB frobs >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>> else if(osName.toLowerCase().indexOf("windows") != -1 ) >>> { >>> String[] Temp = { >>> "COM" // win32 serial ports >>> //"//./COM" // win32 serial ports >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>>If COM3 can be read, it should be found. the ttyUSB should work if >>>thats in the version of RXTXCommDriver.java you have. >>> >>>If this is still a problem, it may be that the driver is erroring on >>>what may be considered normal comm port operations such as setting the >>>speed, timeout, threshold, .. One would have to start looking at each >>>function called in the native open() and read(). >>> >>> >>> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>>seems to find the device using rxtx. Looking at the hardware >>>>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>>>linux. I can't seem to get it to show up as a tty(s#) in linux which >>>>is probably just due to my lack of significant linux knowledge. >>>> >>>> ~ Shawn >>>> >>>>Trent Jarvi wrote: >>>> >>>> >>>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>Has anyone here noticed that virtual comports do not get enumerated >>>>>>via CommPortIdentifier.getPortIdentifiers()?? >>>>>> >>>>>>The device I'm trying to talk to uses an fdti usb to serial >>>>>>convertor with a driver that has it show up as a virtual comport. I >>>>>>can enter this port manually and it will be usable but I cannot get >>>>>>it show up automatically (as in the simple serial demo). Any thoughts >> >>on this? >> >>>>> >>>>>Hi Shawn, >>>>> >>>>>What OS is this and what is the name of the virtual port you are >>>>>trying to open? I suspect the name just needs to be added to >> >>RXTXCommDriver.java. >> >>>>_______________________________________________ >>>>Rxtx mailing list >>>>Rxtx at mail.electronpusher.org >>>>http://www.electronpusher.org/mailman/listinfo/rxtx >>>> >>> >>> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From lyon at docjava.com Mon Jun 20 15:06:08 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 20 Jun 2005 17:06:08 -0400 Subject: [Rxtx] testing Message-ID: Hi All, I am testing my new multi-platform Java Webstart RXTX application (Trent: I could not have done it without you!). So far, I think it will work under Linux (x86), Windows XP, Windows 2000 and MacOS X. The application is available as a Java webstart application at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Edit:Preferences: SerialPort Setup... should bring up a dialog box that enables dialing via the modem. Generally, it does not find internal modems (except on the mac). Why, I don't know. Thanks in advance for trying this new app. All feedback on it is welcome. - Doug Lyon From jasmine at electronpusher.org Tue Jun 21 04:15:53 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Tue, 21 Jun 2005 11:15:53 +0100 Subject: [Rxtx] testing In-Reply-To: References: Message-ID: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > Hi All, > I am testing my new multi-platform Java Webstart RXTX application > (Trent: I could not have done it without you!). > > So far, I think it will work under Linux (x86), Windows XP, > Windows 2000 and MacOS X. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. -J. From taj at www.linux.org.uk Tue Jun 21 05:50:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 12:50:23 +0100 (BST) Subject: [Rxtx] testing In-Reply-To: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> References: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> Message-ID: On Tue, 21 Jun 2005, Jasmine Strong wrote: > > On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > > > Hi All, > > I am testing my new multi-platform Java Webstart RXTX application > > (Trent: I could not have done it without you!). > > > > So far, I think it will work under Linux (x86), Windows XP, > > Windows 2000 and MacOS X. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > on my Mac. > passing -source 1.3 -target 1.3 to javac will compile classes without this problem. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 10:19:25 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 11:19:25 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. Sincerely, Jeremyah Payne From ricardo.trindade at emation.pt Tue Jun 21 13:25:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 20:25:00 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B8698C.2060509@emation.pt> Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > From taj at www.linux.org.uk Tue Jun 21 13:39:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:39:43 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <42B8698C.2060509@emation.pt> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> <42B8698C.2060509@emation.pt> Message-ID: It looks like he has an rs422 device/converter. This is not the problematic 'trying to do protocol X with a serial port' situation unless I'm missing something. I'll follow up with the other email I started. On Tue, 21 Jun 2005, Ricardo Trindade wrote: > Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. > > Payne, Jeremyah L (N-CIM) wrote: > > >Good morning, my name is Jeremyah and I am working on a java project to > >interface with some devices. In short, I have a laptop with a PCMIA > >converter that does RS422 running windows 2000. I also will be > >installing some PCI cards into some Linux boxes that will have probably > >4-8 RS422 ports on them. After doing some reading in order to talk > >with these items using my existing java code I will need an additional > >driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > >trying to get a map sort of where I need to make changes. As I see it, > >I would need to subclass SerialPort to my RS422 interface. That would > >link with a DLL or SO implementation that talks with the hardware. I > >also need to change the listing of working ports in the lookup section > >for serial. Does this seem like I am on the right track? Appreciate > >the support. > > > > > >Sincerely, > >Jeremyah Payne > >_______________________________________________ > >Rxtx mailing list > >Rxtx at mail.electronpusher.org > >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 21 13:40:25 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:40:25 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: On Tue, 21 Jun 2005, Payne, Jeremyah L (N-CIM) wrote: > Good morning, my name is Jeremyah and I am working on a java project to > interface with some devices. In short, I have a laptop with a PCMIA > converter that does RS422 running windows 2000. I also will be > installing some PCI cards into some Linux boxes that will have probably > 4-8 RS422 ports on them. After doing some reading in order to talk with > these items using my existing java code I will need an additional > driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > trying to get a map sort of where I need to make changes. As I see it, I > would need to subclass SerialPort to my RS422 interface. That would link > with a DLL or SO implementation that talks with the hardware. I also > need to change the listing of working ports in the lookup section for > serial. Does this seem like I am on the right track? Appreciate the > support. > Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 13:40:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 14:40:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618954@emss02m08.us.lmco.com> I'd like to except I am dealing with NASA. I am basically building a system to monitor 100+ Units that communicate over RS422. They have some converters in place but want to get rid of them. I'll check through the archives. I had started looking yesterday as was leaving work. -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Ricardo Trindade Sent: Tuesday, June 21, 2005 2:25 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From slavelle at atcorp.com Tue Jun 21 14:58:06 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 21 Jun 2005 15:58:06 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: <42B87F5E.4000403@atcorp.com> > Linux has the standard POSIX like baud rates but if you set the baud rate > to B38400, you can set your own baud base and divisor. This is not POSIX > that I know of. W32 has more capability than POSIX like systems too. So > I did some work to have windows work like Linux via termios.c > > But the code is not quit right. SerialImp.c and termios.c need some > work so all the various buadrates work on Linux and W32. Most other > systems will not work beyond what CommAPI already specifies without > writting kernel drivers. > > This is on my todo list but if someone gets to it first, all the better. Hmm, I guess I didn't read this close enough before. Just to be clear, the pieces to setBaudBase and setDivisor are not yet implemented, correct? Thanks, Shawn From sean_montgomery at baseview.com Tue Jun 21 15:14:08 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 21 Jun 2005 17:14:08 -0400 Subject: [Rxtx] OS X installation - file locations Message-ID: <8AB82C7F-0D19-45F9-AE54-A12C59A8495E@baseview.com> Greetings, I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) using the RXTX installation instructions. RXTX worked fine. Basically you've got: - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions - javax.comm.properties in /System/Library/Frameworks/ JavaVM.framework/Home/lib - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ lib/ext My coworker was concerned that the installation required files to be placed in /System/Library... because those directories are "Apple's" and subject to change at Apple's whim, and that it would be safer (less likely to break when a user updates their OS or Java version or what have you) if all the files could be somewhere in /Library... or / Library/Java. My coworker points out that when 3rd party apps like FrontBase and JBoss need to communicate with Java their jars are placed in /Library/Java/Extensions. Granted that RXTX 2.0 is implementing javax.comm and not just a 3rd party extension, might that be the case - that javax.* stuff needs to be in the Java system files? I'm not the Java maven that my coworker is, so I don't know if any of this is gospel or not. Any OS X/Java experts out there willing to comment? We'd like to be able to install RXTX in the safest, most maintenance free way possible, but if there are specific reasons why javax.comm.properties and comm.jar need to be in /System... then so be it. Any information is welcome, Sean From ricardo.trindade at emation.pt Tue Jun 21 15:56:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 22:56:53 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B88D25.7060604@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050621/f6c9f5fe/attachment-0403.html From jeremyah.l.payne at lmco.com Tue Jun 21 15:22:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 16:22:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618955@emss02m08.us.lmco.com> -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Trent Jarvi Sent: Tuesday, June 21, 2005 2:40 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 As of yet we have not decided on the PCI boards to use yet So I am still waiting to se how we will interface to them. But the laptop is ready to use so ill build a test app for that API for now. The overview of class structure is really what I needed. I guess I will use the 2.1 as you suggested. Thanks for the help thus far! BTW, you guys wouldn't happen to keep class diagrams or anything of that nature around would you? If not I will probably end up having to do some anyway for documentation purposes, I could include them. Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From dmarkman at mac.com Tue Jun 21 18:13:28 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 21 Jun 2005 20:13:28 -0400 Subject: [Rxtx] OS X installation - file locations In-Reply-To: References: Message-ID: <044F520C-585C-4B99-82ED-3BA83DB8CE77@mac.com> Apple doesn't recommend to put jars into the /System/Library/Frameworks/JavaVM.framework/Home/lib/ext folder from other hands it's standard java directory to put extentions if you want to support comm api on whole system then I'd recommend to put jars into the /Library/Java/Extensions folder just like you did if you want to support comm api per user put your jars into the ~/ Library/Java/Extensions On Jun 21, 2005, at 5:14 PM, Java RXTX discussion wrote: > Greetings, > > > I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) > using the RXTX installation instructions. RXTX worked fine. > > > Basically you've got: > - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions > - javax.comm.properties in /System/Library/Frameworks/ > JavaVM.framework/Home/lib > - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ > lib/ext > > > My coworker was concerned that the installation required files to be > placed in /System/Library... because those directories are "Apple's" > and subject to change at Apple's whim, and that it would be safer > (less likely to break when a user updates their OS or Java version or > what have you) if all the files could be somewhere in /Library... or / > Library/Java. My coworker points out that when 3rd party apps like > FrontBase and JBoss need to communicate with Java their jars are > placed in /Library/Java/Extensions. Granted that RXTX 2.0 is > implementing javax.comm and not just a 3rd party extension, might > that be the case - that javax.* stuff needs to be in the Java system > files? > > > I'm not the Java maven that my coworker is, so I don't know if any of > this is gospel or not. Any OS X/Java experts out there willing to > comment? We'd like to be able to install RXTX in the safest, most > maintenance free way possible, but if there are specific reasons why > javax.comm.properties and comm.jar need to be in /System... then so > be it. > > > Any information is welcome, > > > Sean > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Dmitry Markman Dmitry Markman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050622/beea65d0/attachment-0403.html From lyon at docjava.com Thu Jun 23 04:39:47 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 23 Jun 2005 06:39:47 -0400 Subject: [Rxtx] web start + RXTX = strange errors? Message-ID: On: Date: Tue, 21 Jun 2005 11:15:53 +0100 From: Jasmine Strong Writes: An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. ----------- I cannot duplicate your error. My version of Java is: java -version java version "1.4.2_05" Is yours the same? Trent: You wrote: passing -source 1.3 -target 1.3 to javac will compile classes without this problem. ----------- OK, I have updated the disto to work with jdk1.3: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Jasmine: Is this working any better? Thanks! - DL From handzisk at tkn.tu-berlin.de Fri Jun 24 02:37:14 2005 From: handzisk at tkn.tu-berlin.de (Vlado Handziski) Date: Fri, 24 Jun 2005 10:37:14 +0200 (CEST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace Message-ID: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Hi all, let me first express my compliments on the great work you have done with the RXTX library. We have been using the library for some time, and we are at a point where we want to make our code public. For legacy reasons, the code that the RXTX library is bundled with, uses the javax.comm namespace. We have been using the ChangePackage script to change the RXTX2.1 package from gnu.io into javax.comm. We need the independent implementation since we want to be able to directly access /dev/ttyUSBx ports in linux and the CommAPI versions are just not as stable. On the download page, there is a comment that this is in violation of sun's license. Can someone shed more light on this. I was not aware that you can protect the names of the java packages. Best regards, Vlado From ricardo.trindade at emation.pt Fri Jun 24 04:01:17 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 11:01:17 +0100 Subject: [Rxtx] parity missed Message-ID: <42BBD9ED.3060004@emation.pt> Hi, I have a "parity missed error". From previous posts I believe this has to do with CMSPAR not being defined. I checked out 2.1 head from CVS. How can I make sure I do a proper build and CMSPAR is defined ? Perhaps it would be good to have a release snapshot that has this, I think the latest snapshot (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. Another question I have, is why must this depend on kernel headers, why can't it be defined in the RXTX source ? thanks Ricardo From jasmine at electronpusher.org Fri Jun 24 04:09:06 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 24 Jun 2005 11:09:06 +0100 Subject: [Rxtx] web start + RXTX = strange errors? In-Reply-To: References: Message-ID: <644aad2bdbba950f0a2fb12d7dcfd8a6@electronpusher.org> On 23 Jun 2005, at 11:39, Dr. Douglas Lyon wrote: > OK, I have updated the disto to work with jdk1.3: > http://show.docjava.com:8086/book/cgij/code/jnlp/ > addbk.JAddressBook.Main.jnlp > > Jasmine: Is this working any better? Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) -J. From taj at www.linux.org.uk Fri Jun 24 10:54:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 17:54:12 +0100 (BST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: On Fri, 24 Jun 2005, Vlado Handziski wrote: > Hi all, > > let me first express my compliments on the great work you have done with > the RXTX library. > > We have been using the library for some time, and we are at a point where > we want to make our code public. For legacy reasons, the code that the > RXTX library is bundled with, uses the javax.comm namespace. We have been > using the ChangePackage script to change the RXTX2.1 package from gnu.io > into javax.comm. We need the independent implementation since we want to > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > versions are just not as stable. > > On the download page, there is a comment that this is in violation of > sun's license. Can someone shed more light on this. I was not aware that > you can protect the names of the java packages. > > Best regards, > Vlado > I can't provide legal advice as I am not a lawyer. (v) may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are contained in the "java", "javax" or "sun" packages or similar as specified by Sun in any class file naming convention; and The license is in the commapi package from Sun. The above is also in all the EULA's you click through to download from Sun if I'm not mistaken. Simply put, the license taints developers that agree to it. For those developers, Sun has control of the javax.comm namespace. It really does not make sense to put rxtx 2.1 in the javax.comm namespace. It will only cause confusion which I think is the point of the clause above. The gnu.io namespace was perhaps a poor choice and just tossed in when reviewing the license to get out of Sun's namespace. There is nothing in the rxtx license limiting your freedom in this fashion though. Many companies are moving to gnu.io and some distribute it with popular applications you would recognize. I'm tempted to ask you not to contaminate rxtx 2.1 with the javax.comm namespace. You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) extensions to existing classes (which I dont think you are using); it is not just javax.comm. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 24 13:24:09 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 20:24:09 +0100 (BST) Subject: [Rxtx] parity missed In-Reply-To: <42BBD9ED.3060004@emation.pt> References: <42BBD9ED.3060004@emation.pt> Message-ID: On Fri, 24 Jun 2005, Ricardo Trindade wrote: > Hi, > > I have a "parity missed error". From previous posts I believe this > has to do with CMSPAR not being defined. > I checked out 2.1 head from CVS. How can I make sure I do a proper > build and CMSPAR is defined ? Perhaps it would be good to have a release > snapshot that has this, I think the latest snapshot > (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. > > Another question I have, is why must this depend on kernel headers, > why can't it be defined in the RXTX source ? > I used to cheat and grab the CMSPAR from the kernel headers because glibc did not have it. Now rxtx uses the glibc headers and we have a patch in glibc I trust that handles this. It would not be right to override glibc and it wasnt right to use the kernel headers (it really did cause problems). You can override glibc for now with the following in the top of SerialImp.c # define CMSPAR 010000000000 You can check if your distro headers have this right bit looking for the above in bits/termios.h. It should look like this: #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif If it is not defined, please file a bug with your distro as rxtx is not the only thing that will be broken on that distro. I was going to release new cvs snapshots last weekend but got tied up. I'll do it this weekend. I also need to get custom baudrate patches into the cvs snapshot. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Fri Jun 24 13:56:50 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 20:56:50 +0100 Subject: [Rxtx] parity missed In-Reply-To: References: <42BBD9ED.3060004@emation.pt> Message-ID: <42BC6582.2070805@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050624/e3b39631/attachment-0403.html From vlado.handziski at gmail.com Sat Jun 25 06:25:52 2005 From: vlado.handziski at gmail.com (Vlado Handziski) Date: Sat, 25 Jun 2005 14:25:52 +0200 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: <697986ec05062505256ebf381f@mail.gmail.com> Thanks for the clarification. Since changing the bundled source is not an option at this moment, we will consider using javax.comm and RXTX2.0. In the next rewrite, we would probably move to gnu.io . Best regards, Vlado Handziski On 6/24/05, Trent Jarvi wrote: > > On Fri, 24 Jun 2005, Vlado Handziski wrote: > > > Hi all, > > > > let me first express my compliments on the great work you have done with > > the RXTX library. > > > > We have been using the library for some time, and we are at a point > where > > we want to make our code public. For legacy reasons, the code that the > > RXTX library is bundled with, uses the javax.comm namespace. We have > been > > using the ChangePackage script to change the RXTX2.1 package from gnu.io > > into javax.comm. We need the independent implementation since we want to > > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > > versions are just not as stable. > > > > On the download page, there is a comment that this is in violation of > > sun's license. Can someone shed more light on this. I was not aware that > > you can protect the names of the java packages. > > > > Best regards, > > Vlado > > > > I can't provide legal advice as I am not a lawyer. > > (v) may not create, or authorize your licensees to create additional > classes, interfaces, or subpackages that are contained in the "java", > "javax" or "sun" packages or similar as specified by Sun in any class file > naming convention; and > > The license is in the commapi package from Sun. The above is also in all > the EULA's you click through to download from Sun if I'm not mistaken. > > Simply put, the license taints developers that agree to it. For those > developers, Sun has control of the javax.comm namespace. > > It really does not make sense to put rxtx 2.1 in the javax.comm namespace. > It will only cause confusion which I think is the point of the clause > above. The gnu.io namespace was perhaps a poor choice and > just tossed in > when reviewing the license to get out of Sun's namespace. > > There is nothing in the rxtx license limiting your freedom in this fashion > though. Many companies are moving to gnu.io and some > distribute it with > popular applications you would recognize. I'm tempted to ask you not > to contaminate rxtx 2.1 with the javax.comm namespace. > > You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm > using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) > extensions to existing classes (which I dont think you are using); it is > not just javax.comm. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050625/1dadc50e/attachment-0403.html From taj at www.linux.org.uk Sun Jun 26 11:34:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 26 Jun 2005 18:34:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. Message-ID: The attached file should fix baud_base and divisor extensions for Linux The patch is against rxtx 2.1 CVS HEAD. To use this patch, you should set the baud rate to 38400. You can then try SerialPort.setBaudBase(int) and SerialPort.setDivisor(int) There are matching int SerialPort.getBaudBase() and int SerialPort.getDivisor(). What baud bases are available depends upon the serial port card and its driver so this is a bit of a blind attempt on my part. I've looked at the w32 API and I dont see anything available yet. The w32 code in RXTX will probably be figuring out the baud rate based on the tried baud base and divisor and just slamming it at the API for now (the API does something with that but I've not found real documentation on what it does). I dont want to try tinkering with the UART directly yet as that would involve poking machine memory directly and could very easily be error prone in bad ways. I don't expect Solaris or any SysV UNIX systems to work at all with this - ever. It is not standard in any way and will throw Exceptions on everything but Linux (w32 will just fail miserably as it is 1/2 implemented). If anyone has looked at custom baud rates before and has some thoughts or just wants to try the attached untested patch, I'd appreciate any feedback. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- ? autom4te.cache ? build ? output cvs server: Diffing . Index: configure =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure,v retrieving revision 1.35.2.59 diff -u -r1.35.2.59 configure --- configure 16 Oct 2004 16:20:34 -0000 1.35.2.59 +++ configure 26 Jun 2005 16:59:28 -0000 @@ -9644,6 +9644,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { #if defined (__GLIBC__) @@ -9782,6 +9784,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { @@ -9825,7 +9829,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -9837,7 +9841,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 26 Jun 2005 16:59:28 -0000 @@ -218,6 +218,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { #if defined (__GLIBC__) @@ -356,6 +358,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { @@ -399,7 +403,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -411,7 +415,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" cvs server: Diffing CNI cvs server: Diffing MACOSX_IDE cvs server: Diffing MACOSX_IDE/CW cvs server: Diffing MACOSX_IDE/ForPackageMaker cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions cvs server: Diffing MACOSX_IDE/ForPackageMaker/Resources cvs server: Diffing MACOSX_IDE/PB cvs server: Diffing WinCE cvs server: Diffing contrib cvs server: Diffing debian cvs server: Diffing src Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 26 Jun 2005 16:59:29 -0000 @@ -2079,15 +2079,17 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int BaudBase The clock frequency divided by 16. Default * BaudBase is 115200. * @return boolean true on success - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:setBaudBase()"); @@ -2097,10 +2099,11 @@ /** * Extension to CommAPI * @return int BaudBase - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getBaudBase() throws UnsupportedCommOperationException + public int getBaudBase() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getBaudBase()"); @@ -2108,13 +2111,14 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, IOException { if ( debug ) z.reportln( "RXTXPort:setDivisor()"); @@ -2124,10 +2128,11 @@ /** * Extension to CommAPI * @returns int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getDivisor() throws UnsupportedCommOperationException + public int getDivisor() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getDivisor()"); Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 26 Jun 2005 16:59:30 -0000 @@ -1877,16 +1877,27 @@ int fd = get_java_var( env, jobj,"fd","I" ); struct serial_struct sstruct; + if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) + { + goto fail; + } + + sstruct.baud_base = (int) BaudBase; + if ( sstruct.baud_base < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetBaudBase", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetBaudBase", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1914,9 +1925,13 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) ( sstruct.baud_base ) ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetBaudBase", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetBaudBase", strerror( errno ) ); @@ -1950,19 +1965,23 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } if ( sstruct.custom_divisor < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetDivisor", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetDivisor", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1971,7 +1990,7 @@ accept: none perform: Find the Divisor used for custom speeds - return: Divisor + return: Divisor negative value on error. exceptions: Unsupported Comm Operation on systems not supporting TIOCGSERIAL comments: @@ -1990,10 +2009,14 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) sstruct.custom_divisor ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetDivisor", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetDivisor", strerror( errno ) ); @@ -2032,7 +2055,7 @@ /* Open and lock the port so nothing else changes the setting */ - if ( LOCK( filename, pid ) ) goto fail;; + if ( LOCK( filename, pid ) ) goto fail; fd = find_preopened_ports( filename ); if( !fd ) Index: src/SerialPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/Attic/SerialPort.java,v retrieving revision 1.3.2.9 diff -u -r1.3.2.9 SerialPort.java --- src/SerialPort.java 12 Oct 2004 08:59:28 -0000 1.3.2.9 +++ src/SerialPort.java 26 Jun 2005 16:59:30 -0000 @@ -103,13 +103,17 @@ public abstract String getUARTType() throws UnsupportedCommOperationException; public abstract boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getBaudBase() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getDivisor() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setLowLatency() throws UnsupportedCommOperationException; public abstract boolean getLowLatency() cvs server: Diffing src/lfd cvs server: Diffing src/psmisc From uwe at kubosch.no Mon Jun 27 14:13:57 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Mon, 27 Jun 2005 22:13:57 +0200 Subject: [Rxtx] RXTX on FC4 Message-ID: <1119903238.2989.27.camel@BPC0276> Hi all! I just got RXTX to work on Fedora Core 4. The standard download did not work. I had to check the code out from CVS and build it, but then it worked flawlessly. Thanks for your good work. Now I wonder if I should contribute the compiled files so that others will have an easier time than me getting RXTX to work on FC4. What do I do? Who do I talk to? donV From taj at www.linux.org.uk Mon Jun 27 14:29:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 27 Jun 2005 21:29:46 +0100 (BST) Subject: [Rxtx] RXTX on FC4 In-Reply-To: <1119903238.2989.27.camel@BPC0276> References: <1119903238.2989.27.camel@BPC0276> Message-ID: On Mon, 27 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I just got RXTX to work on Fedora Core 4. > > The standard download did not work. > > I had to check the code out from CVS and build it, but then it worked > flawlessly. > > Thanks for your good work. > > Now I wonder if I should contribute the compiled files so that others > will have an easier time than me getting RXTX to work on FC4. What do I > do? Who do I talk to? > > The best thing to do with FC is to contibute an extras RPM. Debian does something like this with their .deb packaging. As rxtx is OS neutral, it is almost impossible to have everything on rxtx.org. If you do get a package in Fedora Extras, I can point a link there. The extra's mail list is here: https://www.redhat.com/mailman/listinfo/fedora-extras-list If it would help to have me release a 'stable' .tar.gz of the source for the RPM submittal process I can do that. It would also trigger upgrades in debian which would not be bad. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Mon Jun 27 16:23:20 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 27 Jun 2005 17:23:20 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: Message-ID: <42C07C58.1030608@atcorp.com> Hey Trent, I installed it and now I get IOExceptions instead of the other one. I'm not sure how those changes would have enabled setDivisor and setBaudBase to work though. Is it significant that this is a USB device emulating a serial port? ~ Shawn From taj at www.linux.org.uk Mon Jun 27 18:07:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 01:07:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: <42C07C58.1030608@atcorp.com> References: <42C07C58.1030608@atcorp.com> Message-ID: On Mon, 27 Jun 2005, Shawn Lavelle wrote: > Hey Trent, > I installed it and now I get IOExceptions instead of the other one. > I'm not sure how those changes would have enabled setDivisor and > setBaudBase to work though. Is it significant that this is a USB device > emulating a serial port? > The USB driver probably does not support this. With USB, the ioctl()'s appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through the linux drivers/usb tree and found to ioctl to support this in Linux 2.6.10. RXTX is not doing very much magic, the patch really only gets the serial struct instead of writing a structure with random values for baudbase and handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel level driver issue not a user space library issue. So if you wanted this to work, the usb serial driver would have to handle the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression after looking through the USB tree quickly. I hope that helps. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Jun 27 18:25:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 27 Jun 2005 20:25:22 -0400 Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) Message-ID: Hi All, I wrote: Jasmine: Is this working any better? And Jasmine says: Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) I am using -source 1.3 and -target 1.3 for the compilation, however, we still seem to have this problem, which my machine (for some reason) does not have. Does anyone have any ideas about what might be the problem? Thanks! - DL From taj at www.linux.org.uk Mon Jun 27 19:04:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 02:04:37 +0100 (BST) Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) In-Reply-To: References: Message-ID: On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I wrote: > Jasmine: Is this working any better? > > And Jasmine says: > Nope. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > > I am using -source 1.3 and -target 1.3 > for the compilation, however, we still seem to have this problem, > which my machine (for some reason) does not have. > Does anyone have any ideas about what might be the problem? > This has shown up in the past with jdk 1.5 compiled jars running on jre 1.4 machines. My guess is either jasmine has an old copy of rxtx with the problem on her machine that is being picked up on the classpath or you have not tried this with jre 1.4. The suggested -source/target fix should avoid the problem. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Mon Jun 27 21:23:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 04:23:55 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: On Tue, 28 Jun 2005, Trent Jarvi wrote: > On Mon, 27 Jun 2005, Shawn Lavelle wrote: > > > Hey Trent, > > I installed it and now I get IOExceptions instead of the other one. > > I'm not sure how those changes would have enabled setDivisor and > > setBaudBase to work though. Is it significant that this is a USB device > > emulating a serial port? > > > > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > > RXTX is not doing very much magic, the patch really only gets the serial > struct instead of writing a structure with random values for baudbase and > handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel > level driver issue not a user space library issue. > > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. > > I hope that helps. > > > It may be possible that you can just modify translate_speed and get_java_baudrate in SerialImp.c to have the new high speds you are after. The defines are in /usr/include/termios.h. #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 You can see many of these are not handled. I dont think CommAPI handled more than 57600 or so. int get_java_baudrate( int native_speed ) { switch( native_speed ) { case B0: return 0; case B50: return 50; case B75: return 75; case B110: return 110; case B134: return 134; case B150: return 150; case B200: return 200; case B300: return 300; case B600: return 600; case B1200: return 1200; case B1800: return 1800; case B2400: return 2400; case B4800: return 4800; case B9600: return 9600; case B19200: return 19200; case B38400: return 38400; case B57600: return 57600; default: return -1; } } int translate_speed( JNIEnv *env, jint speed ) { LEAVE( "RXTXPort:translate_speed" ); switch( speed ) { case 0: return B0; case 50: return B50; case 75: return B75; case 110: return B110; case 134: return B134; case 150: return B150; case 200: return B200; case 300: return B300; case 600: return B600; case 1200: return B1200; case 1800: return B1800; case 2400: return B2400; case 4800: return B4800; case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; #ifdef B57600 case 57600: return B57600; #endif /* B57600 */ #ifdef B115200 case 115200: return B115200; #endif /* B115200 */ #ifdef B230400 case 230400: return B230400; #endif /* B230400 */ #ifdef B460800 case 460800: return B460800; #endif /* B460800 */ #ifdef B14400 case 14400: return B14400; #endif /* B14400 */ #ifdef B28800 case 28800: return B28800; #endif /* B28800 */ #ifdef B128000 /* dima */ case 128000: return B128000; #endif /* dima */ #ifdef B256000 /* dima */ case 256000: return B256000; #endif /* dima */ } /* Handle custom speeds */ if( speed >= 0 ) return speed; else { LEAVE( "RXTXPort:translate_speed: Error condition" ); return -1; } } -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 28 05:20:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 28 Jun 2005 07:20:21 -0400 Subject: [Rxtx] cross-compilation using Make for Mac Message-ID: Hi All, Please excuse the long post; Trent said: >" >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. " Here is what I have on the mac version: java -version java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) When I run: http://show.docjava.com:8086/book/cgij/code/jnlp/math.benchmarks.Dhry.jnlp I get: -- listing properties -- jnlpx.heapsize=NULL,NULL jnlpx.splashport=-1 java.runtime.name=Java(TM) 2 Runtime Environment, Stand... java.protocol.handler.pkgs=com.sun.javaws.net.protocol sun.boot.library.path=/System/Library/Frameworks/JavaVM.fra... java.vm.version=1.4.2-38 awt.nativeDoubleBuffering=true gopherProxySet=false http.auth.serializeRequests=true java.vm.vendor="Apple Computer, Inc." java.vendor.url=http://apple.com/ path.separator=: java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io jnlpx.home=/Applications/Utilities/Java/Java Web... user.country=US sun.os.patch.level=unknown java.vm.specification.name=Java Virtual Machine Specification user.dir=/ java.runtime.version=1.4.2_05-141.4 java.awt.graphicsenv=apple.awt.CGraphicsEnvironment java.endorsed.dirs=/System/Library/Frameworks/JavaVM.fra... os.arch=ppc java.io.tmpdir=/tmp line.separator= java.vm.specification.vendor=Sun Microsystems Inc. jnlpx.remove=false os.name=Mac OS X sun.java2d.fontpath= java.library.path=/Applications/Utilities/Java/Java Web... java.specification.name=Java Platform API Specification java.class.version=48.0 jnlpx.deployment.user.home=/Users/lyon/Library/Caches/Java Web S... java.util.prefs.PreferencesFactory=java.util.prefs.MacOSXPreferencesFactory os.version=10.3.9 user.home=/Users/lyon user.timezone=America/New_York java.security.policy=file:/Applications/Utilities/Java/Jav... java.awt.printerjob=apple.awt.CPrinterJob trustProxy=true java.specification.version=1.4 file.encoding=MacRoman jnlpx.deployment.system.home=/Applications/Utilities/Java/J2SE 5.0... user.name=lyon java.class.path=/Applications/Utilities/Java/Java Web... java.vm.specification.version=1.0 sun.arch.data.model=32 java.home=/System/Library/Frameworks/JavaVM.fra... java.specification.vendor=Sun Microsystems Inc. user.language=en awt.toolkit=apple.awt.CToolkit java.vm.info=mixed mode java.version=1.4.2_05 java.ext.dirs=/Users/lyon/Library/Java/Extensions:/... sun.boot.class.path=/System/Library/Frameworks/JavaVM.fra... java.vendor=Apple Computer, Inc. file.separator=/ java.vendor.url.bug=http://developer.apple.com/java/ sun.cpu.endian=big sun.io.unicode.encoding=UnicodeBig mrj.version=141.3 jnlpx.jvm=/System/Library/Frameworks/JavaVM.fra... sun.cpu.isalist= sun.awt.exception.handler=apple.awt.CToolkit$EventQueueExceptio... javawebstart.version=javaws-1.4.2_05 800 mhz g4,878k ds/sec total time: 1184ms Result: 844594 dhrystone/sec. Load average for last 15 minutes:0.62 So, I feel pretty sure that I have tried this with 1.4. As to modifying the RXTX compilation, that I did not do...and I take your point. I have been using the binary distributions as is. Oops. I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Now when I do a make, I get: make gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known libtool: link: warning: undefined symbols not allowed in i386-pc-mingw32 shared libraries rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ln: `SerialImp.o': File exists make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 So, I do a make clean, then a make: .... (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ar cru .libs/librxtxSerial.a /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o ar: /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o: No such file or directory make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 In the i386 directory, there is a symbolic link left from something: ls -al SerialImp.o lrwxrwxrwx 1 lyon lyon 12 Jun 28 07:03 SerialImp.o -> SerialImp.lo However, the SerialImp.lo is not present (which is the cause of the error, I think). On the other hand, the file I am looking for is present in: i686-pc-linux-gnu Possibly the i386 generation is not clean (of course it is also likely that I am just asking dumb questions, being a newbie to the code and all.). Finally, will this make file regenerate the distro for the mac? I found some really old (from year 2001) files in: cvs/MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions Which I could use for the distro...but I would prefer to do a clean, multi-platform build from make. Thanks! - Doug >On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > >> Hi All, >> I wrote: >> Jasmine: Is this working any better? >> >> And Jasmine says: >> Nope. >> >> An error occurred while launching/running the application. >> >> Title: addbk.JAddressBook.Main >> Vendor: DocJava, Inc. >> Category: Unexpected Error >> >> gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) >> >> > > I am using -source 1.3 and -target 1.3 >> for the compilation, however, we still seem to have this problem, >> which my machine (for some reason) does not have. >> Does anyone have any ideas about what might be the problem? >> > >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. > > >The suggested -source/target fix should avoid the problem. > >-- >Trent Jarvi >tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 28 09:43:41 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 28 Jun 2005 10:43:41 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: <42C1702D.1070307@atcorp.com> > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. There is ioctl stuff in the driver for the chip, but i haven't seen the TIOC*SERIAL entries. That might be why it continues to fail. I did get around the problem, though, by hacking the driver and just specifying the baud rate I need. Now everything works well. Thanks for all the assistance you've provided. ~ Shawn M. Lavelle From taj at www.linux.org.uk Tue Jun 28 12:42:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:42:29 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known Add a compiler flag -DWIN32 The code above should not be compiling on w32 as it is #if !defined(WIN32) You can look at the bottom of Makefile.in to see the w32 compile flags. Search for "WIN32 CrossCompiling from here down" If its still not working, I can set you up with the Bob account. Just email me off the list. W32 compiling is a bit complicated. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 28 12:52:50 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:52:50 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Nods. I did change configure but right now it is only in the baudbase/divisor patch I posted. I'm going to add several extension baud rates that can be supported by normal API calls and commit that today as a followup to my comments yesterday on baudrates. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Wed Jun 29 01:52:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 08:52:10 +0100 (BST) Subject: [Rxtx] [PATCH] More baud rate fixes Message-ID: I went through the native baudrate conversion from Java and added several. This patch is against CVS 2.1 head. I think thats it for baud rate fixes unless someone see something. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- A non-text attachment was scrubbed... Name: baud_base_and_divisor_plus_odd_baudrates.diff.gz Type: application/x-gzip Size: 3291 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050629/4c1ef1c2/baud_base_and_divisor_plus_odd_baudrates.diff-0403.gz From lyon at docjava.com Wed Jun 29 10:33:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 29 Jun 2005 12:33:45 -0400 Subject: [Rxtx] java.comm dependencies Message-ID: Hi All, During a build of the rxtx code, I have left the javax.comm out of the system (on purpose). However, I get an error, at run time: CommPortIdentifier:static initialization() apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: javax/comm/CommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver I am thinking that there is something in the gnu.io.CommPortIdentifier that seeks to load the javax.comm.CommDriver. It was my understanding that we could write code without reference to the javax.comm.CommDriver and that we could work in the gnu namespace. Is this true? Thanks! - Doug From taj at www.linux.org.uk Wed Jun 29 11:16:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 18:16:08 +0100 (BST) Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > During a build of the rxtx code, I have left the > javax.comm out of the system (on purpose). > However, I get an error, at run time: > > CommPortIdentifier:static initialization() > apple.awt.EventQueueExceptionHandler Caught Throwable : > java.lang.NoClassDefFoundError: javax/comm/CommDriver > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > that seeks to load the javax.comm.CommDriver. > > It was my understanding that we could write code without reference > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > Is this true? > Yes. People use 2.1 without javax all the time. There should be no reference to javax at all in rxtx 2.1. You may check your code. I just did a grep through 2.1 and there is nothing. You may look at the classes you are using. If you find javax.comm in your code, replace it with gnu.io and that should be all you need to do. -- Trent Jarvi tjarvi at qbang.org From jayant28k at gmail.com Wed Jun 29 21:49:28 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Thu, 30 Jun 2005 09:19:28 +0530 Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: <6a6a02310506292049778c452f@mail.gmail.com> Trent, I think best idea is to have wiki for rxtx code. So as the traffic is increasing with time. "RXTX" seems to be more popular in embbeded system. Sun Microsystems will always apperciate your efforts on parallel and serial ports commincation based application in IT Industry. Thanks for your help on this forum as "ONE MAN ARMY" ;-) Cheers, Jayant On 6/29/05, Trent Jarvi wrote: > On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > > > Hi All, > > During a build of the rxtx code, I have left the > > javax.comm out of the system (on purpose). > > However, I get an error, at run time: > > > > CommPortIdentifier:static initialization() > > apple.awt.EventQueueExceptionHandler Caught Throwable : > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > > that seeks to load the javax.comm.CommDriver. > > > > It was my understanding that we could write code without reference > > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > > > Is this true? > > > > Yes. People use 2.1 without javax all the time. > > There should be no reference to javax at all in rxtx 2.1. You may check > your code. I just did a grep through 2.1 and there is nothing. You may > look at the classes you are using. > > If you find javax.comm in your code, replace it with gnu.io and that > should be all you need to do. > > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From uwe at kubosch.no Sat Jun 25 02:50:24 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Sat, 25 Jun 2005 10:50:24 +0200 Subject: [Rxtx] RXTX in FC3/FC4 Message-ID: <1119689424.12606.14.camel@BPC0276> Hi all! I am trying to get RXTX to work on Fedora Core, version 3 or 4. I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext directory. I have edited the jre/lib/javax.comm.properties according to the docs. I have tried this with both rxtx 2.0 and 2.1. I have tried on two different machines. I have tried with java 1.4.2 and java 1.5.0, both from Sun. I always get a signall 11 from the native libraries when they are loaded. Is this a common problem? Any help is greatly appreciated. Below is the start of the error message. More can be supplied on demand. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x65015A Function=(null)+0x65015A Library=/lib/ld-linux.so.2 NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) - locked <0xed46f628> (a java.util.Vector) - locked <0xed471708> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xed46ebc0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.InitializeDriver(CommPortIdentifier.java:213) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:248) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:351) at com.jpeterson.x10.module.CM11A.allocate(CM11A.java:1160) at net.sourceforge.cruisecontrol.publishers.X10Publisher.send(X10Publisher.java:182) at net.sourceforge.cruisecontrol.publishers.X10Publisher.turnOff(X10Publisher.java:171) at net.sourceforge.cruisecontrol.publishers.X10Publisher.handleBuild(X10Publisher.java:148) at net.sourceforge.cruisecontrol.publishers.X10Publisher.publish(X10Publisher.java:141) at net.sourceforge.cruisecontrol.Project.publish(Project.java:679) at net.sourceforge.cruisecontrol.Project.build(Project.java:227) at net.sourceforge.cruisecontrol.Project.execute(Project.java:153) at net.sourceforge.cruisecontrol.ProjectWrapper.run(ProjectWrapper.java:66) at java.lang.Thread.run(Thread.java:534) From chris_jh at blueyonder.co.uk Tue Jun 28 05:37:10 2005 From: chris_jh at blueyonder.co.uk (Christopher Harris) Date: Tue, 28 Jun 2005 12:37:10 +0100 Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError Message-ID: <42C13666.9030108@blueyonder.co.uk> Hi I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 32bit) The serial ports work fine with no issues, but when i try to use the parallel port i get this message Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:66) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) I am trying to print a line out to port "/dev/lp0" At first i thought it could not find the librxtxParallel.so file, but when i renamed it i got a different saying it could not find the library. I have tried to run as root no difference. It is really weird, i get no compile errors and the serial ports work fine. I changed the LPRPort.java and commented out the Initialize call method. And just get the same error but for the method open. It is as though it can't see the methods, and yet it can see the library. I did have a bit of check of the JNI implementation in rxtx but could not spot anything. Yours Thankfully Christopher Harris From lyon at docjava.com Thu Jun 30 02:28:09 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 04:28:09 -0400 Subject: [Rxtx] tools Message-ID: Hi All, I have been thinking about automatic cross-platform native method development of Java/C programs. It appears that different binary tools are needed to target different platforms. Configuration seems a bit painful. Is there something better available than make? Is ANT any good at this? Has anyone tried: http://jnipp.sourceforge.net/ Thanks! - Doug From lyon at docjava.com Thu Jun 30 04:11:17 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 06:11:17 -0400 Subject: [Rxtx] javax.comm Message-ID: Hi All, When I load my jar files on a linux box, all is well. However, when I load them on a mac, I get: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver The jar files for the mac are different from the jar files for linux, because recompilation of the native code for the mac has not been easy, for me. As a result, the RXTX jars are tending toward specific versions and platforms. Probably, this is not an ideal situation, but, I suspect, it is common. I have an idea that we could create a single JNLP distro site that we can make reference to that would enable a uniform repository of synchronized signed native methods and jars for RXTX. For example, the one-wire Maxim folks have a real-nice approach where their stuff makes reference to another JNLP file that contains all the stuff we need to make RXTX work. Check it out at: http://www.maxim-ic.com/products/ibutton/software/1wire/OneWireViewer.cfm However, even they have problems on an unconfigured machine: Specified adapter name "DS9097U" is not known * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cannot load default adapter. Please check that the adapter is connected and that no other application is using the port. If you have checked the adapter, the default port might not be selected. Either set the value of the TMEX default using the utility provided with the TMEX Runtime, or create a new file in the /lib folder called onewireviewer.properties with two lines, similar to the following: #native win32 drivers adapter.name={DS9097U} adapter.port=COM1 #or javax.comm drivers adapter.name=DS9097U adapter.port=COM1 The full path to this file should be: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/onewireviewer.properties ---- Wow, that is a show stopper! Configuration is something that we really need to think about as an automatic thing, particularly for web start users. You can't ask a person who wants to run an application to figure out how to alter a properties file. If you know you need one, then get permission and make one...automatically. That makes a lot of sense, to me. Basically, we need an installer. At the very least, all the pre-built binaries and jars needed for the RXTX package on several platforms should be available from a single place. One this happens, we can make a JNLP file that is platform specific, but can give us a level of indirection. Is this something that has been done already? Thanks! - Doug From taj at www.linux.org.uk Thu Jun 30 08:10:22 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 15:10:22 +0100 (BST) Subject: [Rxtx] tools In-Reply-To: References: Message-ID: On Thu, 30 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I have been thinking about automatic cross-platform > native method development of Java/C programs. > > It appears that different binary tools are needed to target different > platforms. Configuration seems a bit painful. > > Is there something better available than make? > > Is ANT any good at this? I'm far from an Ant expert but have used it for other projects. The main problem I see with ant is there is no mainstream support for platform neutral neutral library creation as far as I can tell. I think ant is a fine replacement for make but I've not seen a suitable replacement for autoconf. At that point, make is as good as anything. It should be possible to create a ant build.xml that works on say Solaris, Linux, Windows and Mac OS X. The problem is when you are trying to build a library for embeded ARM from Mac OS X. > Has anyone tried: > http://jnipp.sourceforge.net/ -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:22:02 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:22:02 +0100 (BST) Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <1119689424.12606.14.camel@BPC0276> References: <1119689424.12606.14.camel@BPC0276> Message-ID: On Sat, 25 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I am trying to get RXTX to work on Fedora Core, version 3 or 4. > > I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 > directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext > directory. > > I have edited the jre/lib/javax.comm.properties according to the docs. > > I have tried this with both rxtx 2.0 and 2.1. > > I have tried on two different machines. > > I have tried with java 1.4.2 and java 1.5.0, both from Sun. > > I always get a signall 11 from the native libraries when they are > loaded. Is this a common problem? Any help is greatly appreciated. > Below is the start of the error message. More can be supplied on > demand. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x65015A > Function=(null)+0x65015A > Library=/lib/ld-linux.so.2 > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) If you compile rxtx from source, this will probably go away. I'm not sure what the exact cause is but it looks like the binaries are not suitable for FC3/4. The ABI may have changed since those had been compiled. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:26:56 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:26:56 +0100 (BST) Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError In-Reply-To: <42C13666.9030108@blueyonder.co.uk> References: <42C13666.9030108@blueyonder.co.uk> Message-ID: tOn Tue, 28 Jun 2005, Christopher Harris wrote: > Hi > > I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 > 32bit) > > The serial ports work fine with no issues, but when i try to use the > parallel port i get this message > > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:66) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) > > > I am trying to print a line out to port "/dev/lp0" > > At first i thought it could not find the librxtxParallel.so file, but > when i renamed it i got a different saying it could not find the library. > > I have tried to run as root no difference. > > It is really weird, i get no compile errors and the serial ports work fine. > > I changed the LPRPort.java and commented out the Initialize call method. > And just get the same error but for the method open. > > It is as though it can't see the methods, and yet it can see the library. > I did have a bit of check of the JNI implementation in rxtx but could > not spot anything. > > > You can check if the symbols are in the shared library: nm librxtxSerial.so |grep Initialize If the symbols are not there, there was a build error. Watch very close for build errors while compiling from source. I suspect something isnt behaving right. -- Trent Jarvi tjarvi at qbang.org From allen at adbyrne.us Thu Jun 30 06:55:58 2005 From: allen at adbyrne.us (Allen Byrne) Date: Thu, 30 Jun 2005 07:55:58 -0500 Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> References: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> Message-ID: <200506300755.59159.allen@adbyrne.us> On Thursday 30 June 2005 00:31, rxtx-request at mail.electronpusher.org wrote: > >Message: 8 >Date: Sat, 25 Jun 2005 10:50:24 +0200 >From: Uwe Kubosch >Subject: [Rxtx] RXTX in FC3/FC4 >To: rxtx at mail.electronpusher.org >Message-ID: <1119689424.12606.14.camel at BPC0276> >Content-Type: text/plain > >Hi all! > >I am trying to get RXTX to work on Fedora Core, version 3 or 4. > >I have tried this with both rxtx 2.0 and 2.1. > >I have tried on two different machines. > >I have tried with java 1.4.2 and java 1.5.0, both from Sun. > >I always get a signall 11 from the native libraries when they are >loaded. ?Is this a common problem? ?Any help is greatly appreciated. >Below is the start of the error message. ?More can be supplied on >demand. > >An unexpected exception has been detected in native code outside the VM. >Unexpected Signal : 11 occurred at PC=0x65015A >Function=(null)+0x65015A >Library=/lib/ld-linux.so.2 > I had thi same problem on SUSE9.3 and java 1.5.0. After searching through the archives, I found a patch that required adding a sleep(1000) command in two functions of SerialIO.java. This only was for rxtx2.1, I had no trouble with rxtx2.0. Note, also I had to add the "|1.5*" sequence to the configure.in file to get good *.so libs. Again 2.0 was fine. -- Allen Byrne adbyrne at ieee.org http://modelrr.adbyrne.us From taj at www.linux.org.uk Fri Jun 3 01:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 08:57:29 +0100 (BST) Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 3 09:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 16:57:53 +0100 (BST) Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi at qbang.org From jasmine at electronpusher.org Fri Jun 3 10:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 17:12:21 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 11:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:02:09 +0100 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 11:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:05:10 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From jon.nall at gmail.com Mon Jun 6 09:13:58 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 10:13:58 -0500 Subject: [Rxtx] StackOverflowError Message-ID: I have a fairly small application that is communicating to a microcontroller programmer at 115.2k. I have a test where I try and dump the memory of the microcontroller (whose size is 8k and change). Things are going smoothly and the data looks good. Then after reading out ~6.5k of data, I get a StackOverflowError. The stack trace looks like: CommInterface.serialEvent(): 324 // this is my code RXTXPort.sendEvent(): 732 RXTXPort.eventLoop() [Native] MonitorThread.run(): 1531 I am running on windows and using rxtx-2.1-CVS-20050120. When I increased the stack size to 512k, I could read the entire chip without issue. But that doesn't seem like the right thing to do without root causing what's happening. My code doesn't include any recursion and the stack trace looks terribly short, so I'm a bit confused as to why I'm getting a StackOverflowError. CommInterface.serialEvent() does little more than grab the available bytes, enter a synchronized block, stick them in a common data area for the main thread to use and leave the synchronization block. I guess my question is: are there any known issues with the default stack size when using the latest rxtx on windows? thanks, nall. From taj at www.linux.org.uk Mon Jun 6 09:27:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 16:27:34 +0100 (BST) Subject: [Rxtx] StackOverflowError In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > I have a fairly small application that is communicating to a > microcontroller programmer at 115.2k. I have a test where I try and > dump the memory of the microcontroller (whose size is 8k and change). > Things are going smoothly and the data looks good. Then after reading > out ~6.5k of data, I get a StackOverflowError. The stack trace looks > like: > > CommInterface.serialEvent(): 324 // this is my code > RXTXPort.sendEvent(): 732 > RXTXPort.eventLoop() [Native] > MonitorThread.run(): 1531 > > I am running on windows and using rxtx-2.1-CVS-20050120. When I > increased the stack size to 512k, I could read the entire chip without > issue. But that doesn't seem like the right thing to do without root > causing what's happening. My code doesn't include any recursion and > the stack trace looks terribly short, so I'm a bit confused as to why > I'm getting a StackOverflowError. > > CommInterface.serialEvent() does little more than grab the available > bytes, enter a synchronized block, stick them in a common data area > for the main thread to use and leave the synchronization block. > > I guess my question is: are there any known issues with the default > stack size when using the latest rxtx on windows? > This is the first I've heard of the problem. It is strange as you mention lookin at the stack trace. That cant be taking up too much space. If you just toss the data instead of trying to put it in your work area, does it persist? -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Mon Jun 6 10:09:39 2005 From: lengyel at gmail.com (FL) Date: Mon, 6 Jun 2005 12:09:39 -0400 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on which the jdk1.5.0_03 is installed. I found that the INSTALL documentation seems to be in error. It states that javacomm20-x86.tar.Z (the Java Communications API for Solaris/x86) must be used, in fact this choice led to the following test with theBlackBox sample program in the commapi: root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG BlackBox -p /dev/ttyS0 Port /dev/ttyS0 not found! No serial ports found! Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to cause Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to the Eclipse stable build version 3.1M7 to avoid this. However, I found that using the Solaris/Sparc version of commapi worked on my system. I have documented this on: http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050606/b28fb9a7/attachment-0404.html From taj at www.linux.org.uk Mon Jun 6 10:30:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:30:27 +0100 (BST) Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, FL wrote: > I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on > which the jdk1.5.0_03 is installed. I found that the INSTALL documentation > seems to be in error. It states that javacomm20-x86.tar.Z (the Java > Communications API for Solaris/x86) must be used, in fact this choice led to > the following test with theBlackBox sample program in the commapi: > > root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG > BlackBox -p /dev/ttyS0 > Port /dev/ttyS0 not found! > No serial ports found! > > Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to > cause > Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to > the Eclipse stable build version 3.1M7 to avoid this. > > However, I found that using the Solaris/Sparc version of commapi > worked on my system. > > I have documented this on: > > http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 > Thanks FL. I'll change the documentation to point to the SPARC comm.jar. In the past, any Solaris was good enough, we tried to avoid the w32 comm.jar because it made native calls rxtx would never implement on any OS as they are not platform neutral. I'll withold comments about Sun's comm.jar being different on various CPUs within even the same OS. RXTX 2.1 does not need to do that even acrossed OSs for instance. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 6 10:35:43 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 11:35:43 -0500 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API Message-ID: It seems that Sun's javax.comm site does not include JavaDoc'ed API and the RxTx site has the API, but no real documentation. Is there some site that i'm just missing in my google searches? I'm looking for a copy of the javax.comm API which is documented. Thanks, nall. From taj at www.linux.org.uk Mon Jun 6 10:44:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:44:03 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > It seems that Sun's javax.comm site does not include JavaDoc'ed API > and the RxTx site has the API, but no real documentation. Is there > some site that i'm just missing in my google searches? I'm looking for > a copy of the javax.comm API which is documented. > > Thanks, > nall. Sun's version is with their binary downloads. RXTX tries to match that so I never bothered with more complete JavaDocs. Whatever Sun documents is what we try to do. -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Mon Jun 6 12:13:44 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 6 Jun 2005 14:13:44 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: Message-ID: <20050606181245.528C929D56F@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Trent Jarvi > Sent: Monday, June 06, 2005 12:44 PM > To: Jon Nall; Java RXTX discussion > Subject: Re: [Rxtx] Where can I find JavaDoc on the javax.comm API > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > It seems that Sun's javax.comm site does not include JavaDoc'ed API > > and the RxTx site has the API, but no real documentation. Is there > > some site that i'm just missing in my google searches? I'm > looking for > > a copy of the javax.comm API which is documented. > > > > Thanks, > > nall. > > Sun's version is with their binary downloads. RXTX tries to > match that so I never bothered with more complete JavaDocs. > Whatever Sun documents is what we try to do. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Try http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht ml -Ack From gadelavega at yahoo.com.ar Mon Jun 6 12:58:09 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Mon, 6 Jun 2005 15:58:09 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606181245.528C929D56F@mail.electronpusher.org> Message-ID: <20050606185809.57069.qmail@web14603.mail.yahoo.com> --- "David S. Acker" escribi?: > > -----Original Message----- > > From: rxtx-bounces at mail.electronpusher.org > > [mailto:rxtx-bounces at mail.electronpusher.org] On > Behalf Of Trent Jarvi > > Sent: Monday, June 06, 2005 12:44 PM > > To: Jon Nall; Java RXTX discussion > > Subject: Re: [Rxtx] Where can I find JavaDoc on > the javax.comm API > > > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > > > It seems that Sun's javax.comm site does not > include JavaDoc'ed API > > > and the RxTx site has the API, but no real > documentation. Is there > > > some site that i'm just missing in my google > searches? I'm > > looking for > > > a copy of the javax.comm API which is > documented. > > > > > > Thanks, > > > nall. > > > > Sun's version is with their binary downloads. > RXTX tries to > > match that so I never bothered with more complete > JavaDocs. > > Whatever Sun documents is what we try to do. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > Try > http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > ml > -Ack > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > I'm prety sure it was there... but not anymore. Gonzalo A. de la Vega, BI ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From taj at www.linux.org.uk Mon Jun 6 18:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 01:09:14 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606185809.57069.qmail@web14603.mail.yahoo.com> References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: >> http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > > I'm prety sure it was there... but not anymore. > It is there. Maybe the URL got mangled. Try this http://tinyurl.com/8dfp7 It just redirects you to: http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.html -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 7 05:46:39 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Jun 2005 07:46:39 -0400 Subject: [Rxtx] rxtx under fedora - odd procedures Message-ID: Hi All, I was able to get RXTX communications to work under Fedora, but only after I added myself to the UUCP and LOCK groups, logged out and then logged back in. Both groups appear to be needed in order to access the serial ports. Also the group alter did not take until after I logged out and logged back in. My theory is that you need permission to write to the var/spool directory under fedora and that this is the only way to do it. Logging out and logging back in just seems like an odd thing to do. I suppose some users may have to restart X. Ouch! Is this true? The alter_group command indicates that you need to be an su to alter the group database. Does this mean that my serial port users need a database su able person to use serial port applications under RXTX? If so, what is the procedure to make a transparent install work using Java web start? Should I be prompting users for the su password? Should I be telling users to exit from X and log out? Is this the way other serial communications programs work? Thanks! - Doug From sean_montgomery at baseview.com Tue Jun 7 08:14:51 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 7 Jun 2005 10:14:51 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: >>> http://java.sun.com/products/javacomm/javadocs/javax/comm/package- >>> summary.ht >>> > > >> >> I'm prety sure it was there... but not anymore. >> >> > > It is there. Maybe the URL got mangled. Try this > > http://tinyurl.com/8dfp7 > > It just redirects you to: > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > summary.html > Maybe the issue here is that the info is available without frames from that URL, but when you try to access it with frames (from the link on that page) it doesn't work - it takes you to: http://java.sun.com/products/javacomm/javadocs/index.html Which doesn't have anything useful on it. From gadelavega at yahoo.com.ar Tue Jun 7 08:22:50 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:22:50 -0300 (ART) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: Message-ID: <20050607142251.92850.qmail@web14626.mail.yahoo.com> --- "Dr. Douglas Lyon" escribi?: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the > group > alter did not take until after I logged out and > logged back in. > > My theory is that you need permission to write to > the var/spool > directory under fedora and that this is the only way > to do it. > > Logging out and logging back in just seems like an > odd thing to > do. I suppose some users may have to restart X. > Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port > applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log > out? > Is this the way other serial communications programs > work? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Actually, you need the lock group to acces /var/lock directory, and uucp to acces /dev/ttyS*. You (as root) shuold add all users you will allow to use the serial ports to group uucp and all the ones you'll allow to lock the ports to lock group (rxtx needs both). This is not only for rxtx, but for any use of the serial ports. Next time they login they'll be able to work, so if they are in they'll have to log out first. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From gadelavega at yahoo.com.ar Tue Jun 7 08:23:56 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:23:56 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> Message-ID: <20050607142356.93815.qmail@web14624.mail.yahoo.com> --- Sean Montgomery escribi?: > > On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: > > >>> > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > >>> summary.ht > >>> > > > > > >> > >> I'm prety sure it was there... but not anymore. > >> > >> > > > > It is there. Maybe the URL got mangled. Try this > > > > http://tinyurl.com/8dfp7 > > > > It just redirects you to: > > > > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > > summary.html > > > > Maybe the issue here is that the info is available > without frames > from that URL, but when you try to access it with > frames (from the > link on that page) it doesn't work - it takes you > to: > > http://java.sun.com/products/javacomm/javadocs/index.html > > Which doesn't have anything useful on it. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > That's right, my bad. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From jon.nall at gmail.com Tue Jun 7 08:33:40 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 09:33:40 -0500 Subject: [Rxtx] performance expectations Message-ID: Hi all. I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC microcontroller. The protocol I'm using (which I didn't create) looks like this for the section of code I'm concerned with: PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data PIC -> PC: 0x01 // ACK 0xNN // First 8 bits of data 0xMM // Second 8 bits of data I issue ~2000 of these Read commands. The PIC itself has an input fifo which can store 18 bytes, so I can have 18 read commands in flight at a given time. The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k 8N1. I am measuring the time it takes to perform these 2000 commands at around 30 seconds, which is much longer than I anticipated. With the link fully utilized, I expected: Time per byte transmitted: 115200 / 8 = 14400 bytes/second = ~70 uS/byte Time per response transmitted: ~70 uS/byte * 3 bytes/response = ~210 uS/response Time for 2000 responses to be transmitted: ~210 uS/response * 2000 responses = ~420ms I'm a bit new to this, so I may have made some bad asumptions, but I would have expected a time of a couple of seconds to perform the 2000 reads, not 30+ seconds. I'm obviously missing something here. Can someone help me understand what's going on? Thanks, nall. From taj at www.linux.org.uk Tue Jun 7 09:17:48 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:17:48 +0100 (BST) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the group > alter did not take until after I logged out and logged back in. > > My theory is that you need permission to write to the var/spool > directory under fedora and that this is the only way to do it. > > Logging out and logging back in just seems like an odd thing to > do. I suppose some users may have to restart X. Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log out? > Is this the way other serial communications programs work? > RIght now, rxtx requires you do one of two things. 1) Use lock files (recommended). This requires intervention by the root users to allow users to create lock files and open the ports as you note. 2) configure rxtx with --disable-lockfiles. In this case you need only worry about the permissions on /dev/ttyS* I'm not sure what the default on Fedora is with respect to permisions. This is not very attractive. There is a better way it could be done on Fedora. Fedora comes with lockdev library. I've been considering this for some time. We could use that for the locking and do away with many of the problems. The problem is embeded devices running Linux do not come with liblockdev. But for your use, I would consider adding a new option for locking serial devices using liblockdev. lockdev-devel has a man page with further information. SYNOPSIS #include pid_t dev_testlock( const char * devname); pid_t dev_lock( const char * devname); pid_t dev_relock( const char * devname, pid_t pid); pid_t dev_unlock( const char * devname, pid_t pid); cc [ flag ... ] file ... -llockdev [ library ] This would probably need to be a configure time option to prevent problems on embeded Linux devices but could otherwise be the default on Linux. I could toss a quick patch together if this is confusing. It is actually easier than what rxtx does now. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 09:27:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:27:11 +0100 (BST) Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > Hi all. > I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC > microcontroller. The protocol I'm using (which I didn't create) looks like this > for the section of code I'm concerned with: > > PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data > PIC -> PC: 0x01 // ACK > 0xNN // First 8 bits of data > 0xMM // Second 8 bits of data > > I issue ~2000 of these Read commands. The PIC itself has an input fifo which > can store 18 bytes, so I can have 18 read commands in flight at a given time. > The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k > 8N1. > > I am measuring the time it takes to perform these 2000 commands at around 30 > seconds, which is much longer than I anticipated. With the link fully utilized, > I expected: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte > > Time per response transmitted: > ~70 uS/byte * 3 bytes/response = ~210 uS/response > > Time for 2000 responses to be transmitted: > ~210 uS/response * 2000 responses = ~420ms > > I'm a bit new to this, so I may have made some bad asumptions, but I would have > expected a time of a couple of seconds to perform the 2000 reads, not 30+ > seconds. > > I'm obviously missing something here. Can someone help me understand what's > going on? > I've hooked rxtx in loopback with a scope in the past at 9600 baud (baud rate is not important). Using event notification and just writing a byte on event/read the latencey was around 8-12 ms. The JNI is not an efficient way to use native code - especially for bit banging. So if timing is critical you want to move some of the logic into the native code rather than banging over the JNI. 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your performance. C# has advantages here. If you move your logic into the native layer or use gcj (rxtx will work with that too) most of your latency should vanish. You may have to play with some sleeps in eventLoop at that point to get full native efficiency. With gcj all of rxtx becomes 'native code' as java is just treated as a subset of C++. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 09:38:51 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 10:38:51 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: On 6/7/05, Jon Nall wrote: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte of course that should be divided by 10 to account for the start/stop bits, but it barely changes the end results. From carobizar at free.fr Tue Jun 7 10:21:29 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 7 Jun 2005 18:21:29 +0200 Subject: [Rxtx] (no subject) Message-ID: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Hello ! I am a french student and I have to create an application able to read and write on serial and parallel port and to run on Windows and Linux. For the moment my program run on Windows thanks the Java Communication API (version for Microsoft Windows and Solaris/x86). But it doesn't work on Linux. Does a recent version of an installation documentation exist ? I didn't find one on the RXTX site (nothing for the windows installation and the linux installation deals with a "jcl.jar" that I don't know...). So, I have some questions : 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 version or Linux&w32 version ?) What are the differences between them ? Which of them are the most stable ? 2) Where have I to put the .so and .dll files ? 3) What have I to write on the file javax.comm.properties ? 4) Have I to delete the file win32comm.dll included in the Java Comm API ? 5) Have I to keep both comm.jar and RXTXcomm.jar ? Best regards, Caroline. From debief at telemsa.com Tue Jun 7 10:44:56 2005 From: debief at telemsa.com (DEBIEF Eric) Date: Tue, 7 Jun 2005 18:44:56 +0200 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: <200506071844.56656.debief@telemsa.com> Hi, We are "pushing" RxTx /Java here in a half-duplex link. The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC and application handling) about 25?s/byte. The figures are the barely the same on two environments. Environment 1 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Linux 2.6.3, Mdk 10.0. RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : bytes are lost on the wire. I need to investigate this mystery.... Java : 1.4.2-rc1 Blackdown Environment 2 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Windows 2000 Pro RxTx : 2.0.7. Java : 1.4.2_08 SUN I Hope this help, Eric. _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 7 11:05:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:05:45 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, DEBIEF Eric wrote: > Hi, > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. How many write() calls is this? > > Environment 1 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Linux 2.6.3, Mdk 10.0. > RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : > bytes are lost on the wire. I need to investigate this mystery.... > Java : 1.4.2-rc1 Blackdown > > Environment 2 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Windows 2000 Pro > RxTx : 2.0.7. > Java : 1.4.2_08 SUN > In my event/read/write test I found windows was ~20% faster than linux for some reason (strange part is Windows was in VMWare on the same Linux machine). It was about the same rxtx version. There are many problems with rxtx 1.4 with respect to commapi on windows but its code paths are more simple. What some people want from rxtx is perhaps better served by hacking up the very first release as they just want to read and write which is what rxtx was before Sun released commapi. It sounds like perhaps you are pushing out larger writes which will greatly improve results. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 11:16:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:16:49 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118161289.42a5c989cf6a2@imp4-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: On Tue, 7 Jun 2005 carobizar at free.fr wrote: > > Hello ! > > I am a french student and I have to create an application able to read and write > on serial and parallel port and to run on Windows and Linux. > For the moment my program run on Windows thanks the Java Communication API > (version for Microsoft Windows and Solaris/x86). > But it doesn't work on Linux. > > Does a recent version of an installation documentation exist ? > I didn't find one on the RXTX site (nothing for the windows installation and the > linux installation deals with a "jcl.jar" that I don't know...). > > So, I have some questions : > > 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 > version or Linux&w32 version ?) What are the differences between them ? Which > of them are the most stable ? > Use rxtx 2.0 with commapi for sparc solaris from Sun. If you want your current package javax.comm. > 2) Where have I to put the .so and .dll files ? On Linux just use the source, the configure script will do all of that for you. tar -xzvf rxtx-2.0-version mkdir rxtx-2.0-version/build cd rxtx-2.0-version/build ../configure && make install It will do everything for you. With Windows, you need to create the javax.comm.properties and install the DLL on your path. But you can just use Sun's package too. They are intended to be interchangable. > > 3) What have I to write on the file javax.comm.properties ? Driver=gnu.io.RXTXCommDriver More documentation in INSTALL that comes with the source. Sun's documentation should work too. configure does this for you on Linux. > > 4) Have I to delete the file win32comm.dll included in the Java Comm API ? > No > 5) Have I to keep both comm.jar and RXTXcomm.jar ? > Yes. RXTX 2.1 replaces comm.jar but the package is different (gnu.io) to avoid contaminating Sun's namespace. With rxtx 2.0 you need Sun's comm.jar - they work together. > > Best regards, > Caroline. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Tue Jun 7 12:07:34 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 14:07:34 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 Message-ID: <20050607180632.1543A29D5C8@mail.electronpusher.org> Hello, I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our product includes a built in USB to Serial adapter so that when it is connected to your PC over USB, it appears as a serial port. We had problems with Sun's comm library because it did not detect serial ports coming and going properly. I did run into a few issues with RxTx though. I am building under Windows (we support XP and 2000) under cygwin. I used a simple make file for the c code that works under cygwin and ant to build the java stuff. Attached is a diff file. The patches hit the following issues: ParallelImp.c - I am not using config so there is no config.h for me. Also, gcc didn't like a local file (win32termios.h) getting included with <> . RXTXPort.java - You can get an exception during the writeByte, writeArray, nativeDrain, readByte, read, readArray, readTerminatedArray, and nativeAvailable calls. Without this patch the IOLocked count gets stuck incremented. termios.c - If you try to open a port through CreateFile and get ERROR_ACCESS_DENIED it means someone else is using the port. We need to make sure to use serial_close instead of just close. I found that some devices finish their I/O synchronously. The code was treating this as an error. I also added some checking on the ClearError calls. I found a compile error when debugging is turned on (see the usleep change). SerialImp.c - Again, I don't have a config.h and again we must use quotes and not <> to include win32termios.h . I also commented out a report call since it seems to happen constantly on my system. Feel free to use these in any way that you want or just to ignore them. Thanks! -Dave Acker dacker at nomadio.net Software Engineer Nomadio, Inc. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diffs.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/5671d159/diffs-0401.txt From jon.nall at gmail.com Tue Jun 7 12:28:16 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 13:28:16 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, DEBIEF Eric wrote: > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. Hi. This is helpful, thanks. I can think of 2 reasons I'm not collecting the data as fast as I think I should be: 1) the device to PC connection is not at 100% utilization 2) my SerialPortEventListener processing has too much overhead Are there other explanations I might be missing as to why it takes so long to transfer the data? Thanks. nall. From taj at www.linux.org.uk Tue Jun 7 13:21:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:21:46 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > On 6/7/05, DEBIEF Eric wrote: > > We are "pushing" RxTx /Java here in a half-duplex link. > > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > > and application handling) about 25?s/byte. > > The figures are the barely the same on two environments. > > Hi. > This is helpful, thanks. I can think of 2 reasons I'm not collecting > the data as fast as I think I should be: > 1) the device to PC connection is not at 100% utilization > 2) my SerialPortEventListener processing has too much overhead > > Are there other explanations I might be missing as to why it takes so > long to transfer the data? > Polling the port would probably make more sense. You can set the threshold/timeouts to avoid racing and not deal with the event notification. As mentioned earlier I think the event latency is ~10ms. Keep the event listener around, rxtx 2.* does not close well without it. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 13:27:27 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 14:27:27 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, Trent Jarvi wrote: > Polling the port would probably make more sense. You can set the > threshold/timeouts to avoid racing and not deal with the event > notification. As mentioned earlier I think the event latency is ~10ms. Trent, Thanks for the response. Just to make sure I understand what you're talking about, when you say event latency, do you mean the time it takes from when the byte hits the PC's comm port to when rxtx presents it to user code? So if the link is 100% utilized, will my user code see "hiccups" or a steady stream of data? Thanks for helping a serial port newbie. nall. From dacker at nomadio.net Tue Jun 7 13:32:20 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 15:32:20 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <20050607193118.5499329CAA0@mail.electronpusher.org> Some folks asked about the make file and ant steps. I have JAVA_HOME set as follows: $ echo $JAVA_HOME C:\Program Files\Java\jdk1.5.0_01 I have all the code in rxtx/src put into gnu/io . The make file here doesn't have optimizations turned on. We have not tested with it yet. --------------Begin Makefile------------------ CPPFLAGS="-I$(JAVA_HOME)/include" "-I$(JAVA_HOME)/include/win32" SOBJECTS=SerialImp.o fuserImp.o termios.o fixup.o init.o POBJECTS=ParallelImp.o termios.o init.o DLLS=rxtxParallel.dll rxtxSerial.dll all: $(CLASSES) $(DLLS) rxtxSerial.dll: $(SOBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(SOBJECTS) rxtxParallel.dll: $(POBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(POBJECTS) clean: rm -fv $(SOBJECTS) $(POBJECTS) $(DLLS) %.o: %.c gcc -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< %.o: %.cpp g++ -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< --------------End Makefile------------------ Here is the ant target I use to build the rxtx libs. Our build puts the class files in a bin dir. We copy the dlls to a deploy dir and to the build dir. Eclipse seems to like the dlls in the build dir. The deploy dir is used when we build our full package. --------------Begin Ant Section------------------ --------------End Ant Section------------------ > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > David S. Acker > Sent: Tuesday, June 07, 2005 2:08 PM > To: 'Java RXTX discussion' > Subject: [Rxtx] Patches to 2.1-7pre17 > > Hello, > I am using RxTx with the Nomadio Sensor, > http://www.nomadio.net/ . Our product includes a built in > USB to Serial adapter so that when it is connected to your PC > over USB, it appears as a serial port. We had problems with > Sun's comm library because it did not detect serial ports > coming and going properly. > > I did run into a few issues with RxTx though. I am building > under Windows (we support XP and 2000) under cygwin. I used > a simple make file for the c code that works under cygwin and > ant to build the java stuff. Attached is a diff file. The > patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h > for me. Also, gcc didn't like a local file (win32termios.h) > getting included with <> . > > RXTXPort.java - You can get an exception during the > writeByte, writeArray, nativeDrain, readByte, read, > readArray, readTerminatedArray, and nativeAvailable calls. > Without this patch the IOLocked count gets stuck incremented. > > termios.c - If you try to open a port through CreateFile and > get ERROR_ACCESS_DENIED it means someone else is using the > port. We need to make sure to use serial_close instead of > just close. I found that some devices finish their I/O > synchronously. The code was treating this as an error. I > also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we > must use quotes and not <> to include win32termios.h . I > also commented out a report call since it seems to happen > constantly on my system. > > Feel free to use these in any way that you want or just to > ignore them. > Thanks! > > -Dave Acker > dacker at nomadio.net > Software Engineer > Nomadio, Inc. > From taj at www.linux.org.uk Tue Jun 7 13:37:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:37:45 +0100 (BST) Subject: [Rxtx] Re: Stack Smashing Attack In-Reply-To: <200506072012.48860.ferdinand.tatzig@web.de> References: <200506072012.48860.ferdinand.tatzig@web.de> Message-ID: On Tue, 7 Jun 2005, Ferdinand Tatzig wrote: > Dear Trent > > I am using RXTX for serial port communication between a PC and a payment > transaction terminal. > When I run my application under Windows 2000, an i386-Linux or an i386-FreeBSD > it works as I expect it to do. However, when I start it to run on AMD64 > machine with a 64-bit Gentoo Linux, the VM terminates with the following > error: > > Port found: /dev/ttyS0 > java: stack smashing attack in function configure_port() > > I am using a 64-bit Blackdown-1.4.2-01 VM. > > I have searched the internet but have found no information about this error. > > This is the code of the method which initializes the serial port: > > /** > * initializes a serial port for communication with a terminal; only > * accessible within this class > * > * @param communication > * @param serialPortToBeInitialized > * @param tillInterfaceEventListener > */ > private TillInterfaceSerialPort(Communication communication, > String serialPortToBeInitialized, > TillInterfaceEventListener tillInterfaceEventListener) > throws IOException, PortInUseException, > TillInterfaceSerialPortNotFoundException, > TooManyListenersException, UnsupportedCommOperationException { > serialPortName = "not initialized yet"; > CommPortIdentifier portId = null; > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > boolean portFound = false; > String temporarySerialPortName = "not initialized yet"; > > // look for a serial port > while (portList.hasMoreElements() && !portFound) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > temporarySerialPortName = portId.getName(); > if (temporarySerialPortName.equals(serialPortToBeInitialized)) { > System.out.print("Port found: "); > System.out.println(temporarySerialPortName); > serialPortName = temporarySerialPortName; > portFound = true; > } > } > } > if (portFound) { > > // initialize the found port - this command causes the VM to terminate > serialPort = (SerialPort) portId > .open( > TillInterfaceConstants.APPLICATION_NAME, > TillInterfaceConstants > .TIMEOUT_IN_MILLISECONDS_FOR_OPENING_OF_COMMUNICATION_PORT); > > // add an event listener which listens > // on the serial port and notifies the > // serial port object when input bytes > // have been received at the port > serialPort.addEventListener(tillInterfaceEventListener); > serialPort.notifyOnDataAvailable(true); > > // initialize the physical layer > // parameters of the serial port > serialPort.setSerialPortParams(TillInterfaceConstants.BAUD_RATE, > SerialPort.DATABITS_8, SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > // set the inter-character > // timeout (T2) > serialPort > .enableReceiveTimeout(TillInterfaceConstants.INTERCHARACTER_TIMEOUT_IN_MILLISECONDS); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > } else > throw new TillInterfaceSerialPortNotFoundException(); > } > > Any hint to solve this problem would be kindly appreciated. > The only thing that comes to mind here after looking at the offending function is rxtx used to include asm/termios.h but now we moved to termios.h and had glibc fix their headers. The asm/termios.h caused problems as its termios was smaller than the actual termios. This should be fixed in current rxtx versions but you can just glance at SerialImp.c and make sure it does not include asm/termios.h. I've cc'd the rxtx mail list because there was one other mention of stack problems recently. I have used rxtx on opteron systems with success. I have a bug I'm trying hard to reproduce on suse 64 bit (circa linux 2.4.19) systems though. So far I have not been able to reproduce the bug. That said, with gentoo... I like gentoo but I seriously doubt they do any QA with their kernel and Java. I've seen problems before. If you use gentoo and have Java problems, at least stick to Linus (that is an s there) kernels while using Java. I'm not an expert on gentoo but I've seen patches go into experimental kernels that turn out to break java and are reverted before going to Linus just before I see problems with gentoo on this list. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:16:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:16:14 +0100 (BST) Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: On Tue, 7 Jun 2005, David S. Acker wrote: > Hello, > I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our > product includes a built in USB to Serial adapter so that when it is > connected to your PC over USB, it appears as a serial port. We had problems > with Sun's comm library because it did not detect serial ports coming and > going properly. > > I did run into a few issues with RxTx though. I am building under Windows > (we support XP and 2000) under cygwin. I used a simple make file for the c > code that works under cygwin and ant to build the java stuff. Attached is a > diff file. The patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h for me. Also, > gcc didn't like a local file (win32termios.h) getting included with <> . > > RXTXPort.java - You can get an exception during the writeByte, writeArray, > nativeDrain, readByte, read, readArray, readTerminatedArray, and > nativeAvailable calls. Without this patch the IOLocked count gets stuck > incremented. > > termios.c - If you try to open a port through CreateFile and get > ERROR_ACCESS_DENIED it means someone else is using the port. We need to > make sure to use serial_close instead of just close. I found that some > devices finish their I/O synchronously. The code was treating this as an > error. I also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we must use quotes > and not <> to include win32termios.h . I also commented out a report call > since it seems to happen constantly on my system. > > Feel free to use these in any way that you want or just to ignore them. > Thanks! > Hi Dave These patches look great as is. Thanks. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:33:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:33:16 +0100 (BST) Subject: [Rxtx] Patch to IOLocked (fwd) Message-ID: This appears to be another solution to the locking. Chris, the other option just moves the locking into the finally clause which I think would be a little cleaner though I'm posting this patch to so people can comment. -- Trent Jarvi tjarvi at qbang.org ---------- Forwarded message ---------- Date: Wed, 1 Jun 2005 13:01:32 +0100 From: Christopher Dawes To: taj at www.linux.org.uk Subject: Patch to IOLocked Do you want me to check it out of CVS and then submit changes? Christopher -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXPort.java.diff Type: application/octet-stream Size: 6965 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/c442f9fc/RXTXPort.java-0404.obj From Christopher.Dawes at retail-logic.com Wed Jun 8 00:57:24 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 8 Jun 2005 07:57:24 +0100 Subject: [Rxtx] Patch to IOLocked (fwd) [Virus Checked] In-Reply-To: Message-ID: Agreed, much better Java :-) Thanks Christopher ------------------------------------------- Consultant Engineer Retail Logic Limited Fleet GU51 3TZ Tel: +44 (0)1252 644377 Mob: +44 (0)7899 842759 Fax: +44 (0)1252 776708 rxtx-bounces at mail.electronpusher.org wrote on 07/06/2005 21:33:16: > > This appears to be another solution to the locking. Chris, the other > option just moves the locking into the finally clause which I think would > be a little cleaner though I'm posting this patch to so people can > comment. > > -- > Trent Jarvi > tjarvi at qbang.org > > ---------- Forwarded message ---------- > Date: Wed, 1 Jun 2005 13:01:32 +0100 > From: Christopher Dawes > To: taj at www.linux.org.uk > Subject: Patch to IOLocked > > Do you want me to check it out of CVS and then submit changes? > > Christopher[attachment "RXTXPort.java.diff" deleted by Chris > Dawes/Retaillogic/NISABA] _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx From zempftman at gmail.com Wed Jun 8 07:57:25 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 09:57:25 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Maxwell Zempftman Date: May 27, 2005 5:01 PM Subject: Re: [Rxtx] Kaffe & rxtx & armv5b To: rxtx at mail.linuxgrrls.org Here are the results from working this week: The "NullPointerExceptions" are generated by the software when I choose a bad device file. I discovered that this occurs on the i686-RedHat box as well. This exception seems to be generated only by this particular application, and not by the example programs in contrib. So, for example: java MyApp /dev/null <-- generates NullPointerException java MyApp fake <-- generates NullPointerException java MyApp /dev/ttyS0 <-- does not generate NullPointerException Using the program CommCheck (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it appears as though /dev/ttyS0 is the only valid serial device file on the XScale device, so the errors I was getting are not really be bugs. Although /dev/ttyS0 did not generate NullPointerExceptions, I did encounter this error: --start java MyApp /dev/ttyS0 (going mostly from memory, not exact) PortList.hasMoreElements: true Listening on: /dev/ttyS0 Client connected. >From net: echo kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 vmExcept_setJNIFrame Assert: on 'fp != 0' failed. --end I took a look at exception.h, and it seems as though the problematic code does not exist in newer versions of Kaffe (I have been using CVS-2004-11). Next week I will try to use a newer version, although so far everything but CVS-2004-11 has failed. Also, I the device files I need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with something like this? Thanks, Max. > On 5/21/05, Trent Jarvi wrote: > > I'm not sure what is wrong in the first part. It sounds like your > > application may be swallowing an exception while trying to enumerate the > > port or open it. The usual mistake made it not having permissions to > > either open the port or create the lockfile. There should be examples in > > the contrib directory you can try that enumerate and open ports. Maybe > > that will give you some hints. > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > Sun's code limiting you there though you do need to compile and install > > rxtx for the XScale with Sun's Commapi. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > From taj at www.linux.org.uk Wed Jun 8 08:22:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 15:22:44 +0100 (BST) Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > ---------- Forwarded message ---------- > From: Maxwell Zempftman > Date: May 27, 2005 5:01 PM > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > To: rxtx at mail.linuxgrrls.org > > > Here are the results from working this week: > > The "NullPointerExceptions" are generated by the software when I > choose a bad device file. I discovered that this occurs on the > i686-RedHat box as well. This exception seems to be generated only by > this particular application, and not by the example programs in > contrib. So, for example: > > java MyApp /dev/null <-- generates NullPointerException > java MyApp fake <-- generates NullPointerException > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > Using the program CommCheck > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > appears as though /dev/ttyS0 is the only valid serial device file on > the XScale device, so the errors I was getting are not really be bugs. > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > encounter this error: > > --start > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > PortList.hasMoreElements: true > Listening on: /dev/ttyS0 > Client connected. > >From net: echo > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > --end > > I took a look at exception.h, and it seems as though the problematic > code does not exist in newer versions of Kaffe (I have been using > CVS-2004-11). Next week I will try to use a newer version, although so > far everything but CVS-2004-11 has failed. Also, I the device files I > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > something like this? > In RXTXCommDriver, just look for the following code and add /dev/ttyM to the list. Moxa? if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } So: if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyM", // for Moxa ports "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } Linux just has way too many port types to try enumerating them all. There is potential we can add them back in with udev now. > Thanks, > Max. > > > On 5/21/05, Trent Jarvi wrote: > > > I'm not sure what is wrong in the first part. It sounds like your > > > application may be swallowing an exception while trying to enumerate the > > > port or open it. The usual mistake made it not having permissions to > > > either open the port or create the lockfile. There should be examples in > > > the contrib directory you can try that enumerate and open ports. Maybe > > > that will give you some hints. > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > Sun's code limiting you there though you do need to compile and install > > > rxtx for the XScale with Sun's Commapi. > > > > > > -- > > > Trent Jarvi > > > tjarvi at qbang.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Wed Jun 8 12:16:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 08 Jun 2005 13:16:03 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A60B8D.8080500@cs.umn.edu> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> Message-ID: <42A735E3.8040706@atcorp.com> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual serial comport. This isn't so much of a problem, what is, however, is that the comport does not appear to be able to be set to any arbitrary speed, only those from the data_rate enum. I've not found much on using different speeds, has anyone else encountered anything similar? I greatly appreciate any and all comments and suggestions. Thanks in advance, ~ Shawn Lavelle From zempftman at gmail.com Wed Jun 8 12:50:58 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 14:50:58 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: Thanks Trent! That will solve one of the problems. I don't know when my next chance to work on it will be, but I still need to figure out the error I got when I tried opening '/dev/ttyS0' on the Moxa device regarding a failed assertion, seemed to be a Kaffe issue. Thanks for you help, hope to have results soon, Max Englander. On 6/8/05, Trent Jarvi wrote: > On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > > > ---------- Forwarded message ---------- > > From: Maxwell Zempftman > > Date: May 27, 2005 5:01 PM > > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > > To: rxtx at mail.linuxgrrls.org > > > > > > Here are the results from working this week: > > > > The "NullPointerExceptions" are generated by the software when I > > choose a bad device file. I discovered that this occurs on the > > i686-RedHat box as well. This exception seems to be generated only by > > this particular application, and not by the example programs in > > contrib. So, for example: > > > > java MyApp /dev/null <-- generates NullPointerException > > java MyApp fake <-- generates NullPointerException > > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > > > Using the program CommCheck > > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > > appears as though /dev/ttyS0 is the only valid serial device file on > > the XScale device, so the errors I was getting are not really be bugs. > > > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > > encounter this error: > > > > --start > > > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > > > PortList.hasMoreElements: true > > Listening on: /dev/ttyS0 > > Client connected. > > >From net: echo > > > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > > > --end > > > > I took a look at exception.h, and it seems as though the problematic > > code does not exist in newer versions of Kaffe (I have been using > > CVS-2004-11). Next week I will try to use a newer version, although so > > far everything but CVS-2004-11 has failed. Also, I the device files I > > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > > something like this? > > > > > In RXTXCommDriver, just look for the following code and add /dev/ttyM to > the list. Moxa? > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > So: > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyM", // for Moxa ports > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > Linux just has way too many port types to try enumerating them all. There > is potential we can add them back in with udev now. > > > > > Thanks, > > Max. > > > > > On 5/21/05, Trent Jarvi wrote: > > > > I'm not sure what is wrong in the first part. It sounds like your > > > > application may be swallowing an exception while trying to enumerate the > > > > port or open it. The usual mistake made it not having permissions to > > > > either open the port or create the lockfile. There should be examples in > > > > the contrib directory you can try that enumerate and open ports. Maybe > > > > that will give you some hints. > > > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > > Sun's code limiting you there though you do need to compile and install > > > > rxtx for the XScale with Sun's Commapi. > > > > > > > > -- > > > > Trent Jarvi > > > > tjarvi at qbang.org > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- > Trent Jarvi > tjarvi at qbang.org > From taj at www.linux.org.uk Wed Jun 8 12:53:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 19:53:10 +0100 (BST) Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A735E3.8040706@atcorp.com> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: On Wed, 8 Jun 2005, Shawn Lavelle wrote: > Hello, > I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate > with a virtual serial comport. This isn't so much of a problem, what > is, however, is that the comport does not appear to be able to be set to > any arbitrary speed, only those from the data_rate enum. I've not found > much on using different speeds, has anyone else encountered anything > similar? I greatly appreciate any and all comments and suggestions. > This problem is a bit more tricky than it should be. POSIX systems just have a few specified baud rates. Solaris is one of these systems. CommAPI baud rates probably came from someone looking at Solaris. RXTX tries to be POSIX like. W32 is treated as a POSIX like system via a termios.c file in rxtx. Serial ports have baudbase and divisor. So you can set these to come close to the baudrate you want. Some funky equipment like automobile test equipment use baud rates that are not really possible with PC hardware. But if you get as close as possible by changing baud base and divisor, it works. Windows can actually do this for you. I don't know exactly what their code does but if you pass a baudrate to windows, it will guestimate a baudbase and divisor. So you just pass it 10200 baud and it does its job. This is not of very much use the way rxtx does things though. Linux has the standard POSIX like baud rates but if you set the baud rate to B38400, you can set your own baud base and divisor. This is not POSIX that I know of. W32 has more capability than POSIX like systems too. So I did some work to have windows work like Linux via termios.c But the code is not quit right. SerialImp.c and termios.c need some work so all the various buadrates work on Linux and W32. Most other systems will not work beyond what CommAPI already specifies without writting kernel drivers. This is on my todo list but if someone gets to it first, all the better. -- Trent Jarvi tjarvi at qbang.org From carobizar at free.fr Thu Jun 9 06:39:10 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Thu, 9 Jun 2005 14:39:10 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: <1118320750.42a8386e6d3ce@imp5-q.free.fr> Hi ! Thank you for all your advices. I managed to use rxtx on Windows but I have still some difficulties on Linux. I have yet follow your instructions and the configure file has created : - librxtxSerial.so and librxtxParallel.so in the directory /usr/java/j2sdk1.4.2_08/jre/lib/i386 - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the directory /usr/java/j2sdk1.4.2_08/jre/lib - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext But when I run my program, Some exceptions occur : Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver So, 1) What have I forgotten ? 2) Is it possible to make my application run on Linux without the jdk (only the jre) ? Best regards, Caroline. From taj at www.linux.org.uk Thu Jun 9 07:28:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 9 Jun 2005 14:28:05 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118320750.42a8386e6d3ce@imp5-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: On Thu, 9 Jun 2005 carobizar at free.fr wrote: > Hi ! > Thank you for all your advices. > I managed to use rxtx on Windows but I have still some difficulties on Linux. > I have yet follow your instructions and the configure file has created : > - librxtxSerial.so and librxtxParallel.so in the directory > /usr/java/j2sdk1.4.2_08/jre/lib/i386 > - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the > directory /usr/java/j2sdk1.4.2_08/jre/lib > - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext > > But when I run my program, Some exceptions occur : > Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while > loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > com.sun.comm.SolarisDriver > > So, > 1) What have I forgotten ? > The native (.so) libraries are not installed in a directory the JRE is looking for native libraries in. You may look around and see where the .so libraries are in the JRE. I don't know that the jre/lib/i386 directory is specified as a required directory for JREs. I noticed some do not use it. You may try printing the java.libarary.path to see your options. It is also possible to alter the java.library.path. > 2) Is it possible to make my application run on Linux without the jdk (only the > jre) ? Yes. Though installation from source with the JDK is less error prone. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0401.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 7 15:03:09 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 07 Jun 2005 16:03:09 -0500 Subject: [Rxtx] Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <42A60B8D.8080500@cs.umn.edu> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual comport. This isn't so much of a problem, what is, however, is that the comport is only ever set to 9600 baud. I've not found this as a documented bug, has anyone else encountered anything similar? I'll try and provide more detail tomorrow, but if anyone has any suggestions or encountered this before, I'd like to hear about it. Thanks in advance, ~ Shawn Lavelle From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0404.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0404.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0404.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Mon Jun 20 01:04:40 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 20 Jun 2005 08:04:40 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: <42B66A88.4060806@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050620/9be208a1/attachment-0404.html From fbalzarro at libero.it Mon Jun 20 02:33:52 2005 From: fbalzarro at libero.it (Fabio Balzarro) Date: Mon, 20 Jun 2005 10:33:52 +0200 Subject: [Rxtx] RXTXPort:close detected bad file descriptor Message-ID: I'm using RXTX libraries on IPAQ 4150 PDA with Windows CE 4.20 and Jeode. When I close a serial port with sp.close() (where sp is a SerialPort) sometimes an error occour 1119256168085: RXTXPort:close detected bad file descriptor What can I do? Thanks Fabio ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From slavelle at atcorp.com Mon Jun 20 08:08:19 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 20 Jun 2005 09:08:19 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: <42B6CDD3.4040409@atcorp.com> It turns out that I did have a driver-not-used issue which has now been resolved and I can use RxTx on it (had to add ttyUSB as a valid port), but only at standard baud rates. Does USB have the same restrictions on port speed as regular RS232? ~ Shawn Trent Jarvi wrote: > Just a note here. > > I have requested a FTDI usb device and they offered to send one for the > purpose of trying to get rxtx working. I have no idea how long that takes > though. > > > On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > > >>I'm afraid we're just using the latest version from the FTDI website. I've >>not yet played with linux properly with this and unfortunately I run gentoo >>and haven't yet successfully compiled in the ftdi driver. I'll let you know >>if I get any success. >> >>Appologies >> >>Christopher >> >>-----Original Message----- >>From: rxtx-bounces at mail.electronpusher.org >>[mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle >>Sent: 15 June 2005 00:00 >>To: Java RXTX discussion >>Subject: Re: [Rxtx] Virtual Com Ports >> >>Hmm, the latter sounds like a lot of work. It does find the virtual comport >>in windows, i must have just missed it earlier (sign of a long day). On the >>linux side, I suspect that something is not correct with the driver >>installation becuase it does not give me a tty for it :( >> >>Christopher, May I ask what driver you are using for your FTDI chip? >>Did you ever encounter problems with not getting a tty assigned for it? >> >> >> Thanks for all your help! >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>They will have to show up as a tty device in Linux. Probably ttyUSB? >>>That will need an entry in RXTXCommDriver.java. If they dont show up >>>as a tty device, rxtx cant treat it like a serial port. It just wont >> >>work. >> >>>With COM3, rxtx will try to open the port and perform a timed out read. >>>Usually if a port is not there, the read blows up or the open blows up. >>>Timing out is fine. COM3 used to share interrupts with COM1. I know >>>you can reassign ports in XP. RXTX scans up through COM255. You may >>>try moving it. >>> >>> >>>The code in question is the following in RXTXCommDriver.java >>> >>> >>> if(osName.equals("Linux")) >>> { >>> String[] Temp = { >>> "ttyS", // linux Serial Ports >>> "ttySA", // for the IPAQs >>> "ttyUSB" // for USB frobs >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>> else if(osName.toLowerCase().indexOf("windows") != -1 ) >>> { >>> String[] Temp = { >>> "COM" // win32 serial ports >>> //"//./COM" // win32 serial ports >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>>If COM3 can be read, it should be found. the ttyUSB should work if >>>thats in the version of RXTXCommDriver.java you have. >>> >>>If this is still a problem, it may be that the driver is erroring on >>>what may be considered normal comm port operations such as setting the >>>speed, timeout, threshold, .. One would have to start looking at each >>>function called in the native open() and read(). >>> >>> >>> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>>seems to find the device using rxtx. Looking at the hardware >>>>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>>>linux. I can't seem to get it to show up as a tty(s#) in linux which >>>>is probably just due to my lack of significant linux knowledge. >>>> >>>> ~ Shawn >>>> >>>>Trent Jarvi wrote: >>>> >>>> >>>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>Has anyone here noticed that virtual comports do not get enumerated >>>>>>via CommPortIdentifier.getPortIdentifiers()?? >>>>>> >>>>>>The device I'm trying to talk to uses an fdti usb to serial >>>>>>convertor with a driver that has it show up as a virtual comport. I >>>>>>can enter this port manually and it will be usable but I cannot get >>>>>>it show up automatically (as in the simple serial demo). Any thoughts >> >>on this? >> >>>>> >>>>>Hi Shawn, >>>>> >>>>>What OS is this and what is the name of the virtual port you are >>>>>trying to open? I suspect the name just needs to be added to >> >>RXTXCommDriver.java. >> >>>>_______________________________________________ >>>>Rxtx mailing list >>>>Rxtx at mail.electronpusher.org >>>>http://www.electronpusher.org/mailman/listinfo/rxtx >>>> >>> >>> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From lyon at docjava.com Mon Jun 20 15:06:08 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 20 Jun 2005 17:06:08 -0400 Subject: [Rxtx] testing Message-ID: Hi All, I am testing my new multi-platform Java Webstart RXTX application (Trent: I could not have done it without you!). So far, I think it will work under Linux (x86), Windows XP, Windows 2000 and MacOS X. The application is available as a Java webstart application at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Edit:Preferences: SerialPort Setup... should bring up a dialog box that enables dialing via the modem. Generally, it does not find internal modems (except on the mac). Why, I don't know. Thanks in advance for trying this new app. All feedback on it is welcome. - Doug Lyon From jasmine at electronpusher.org Tue Jun 21 04:15:53 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Tue, 21 Jun 2005 11:15:53 +0100 Subject: [Rxtx] testing In-Reply-To: References: Message-ID: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > Hi All, > I am testing my new multi-platform Java Webstart RXTX application > (Trent: I could not have done it without you!). > > So far, I think it will work under Linux (x86), Windows XP, > Windows 2000 and MacOS X. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. -J. From taj at www.linux.org.uk Tue Jun 21 05:50:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 12:50:23 +0100 (BST) Subject: [Rxtx] testing In-Reply-To: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> References: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> Message-ID: On Tue, 21 Jun 2005, Jasmine Strong wrote: > > On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > > > Hi All, > > I am testing my new multi-platform Java Webstart RXTX application > > (Trent: I could not have done it without you!). > > > > So far, I think it will work under Linux (x86), Windows XP, > > Windows 2000 and MacOS X. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > on my Mac. > passing -source 1.3 -target 1.3 to javac will compile classes without this problem. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 10:19:25 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 11:19:25 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. Sincerely, Jeremyah Payne From ricardo.trindade at emation.pt Tue Jun 21 13:25:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 20:25:00 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B8698C.2060509@emation.pt> Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > From taj at www.linux.org.uk Tue Jun 21 13:39:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:39:43 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <42B8698C.2060509@emation.pt> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> <42B8698C.2060509@emation.pt> Message-ID: It looks like he has an rs422 device/converter. This is not the problematic 'trying to do protocol X with a serial port' situation unless I'm missing something. I'll follow up with the other email I started. On Tue, 21 Jun 2005, Ricardo Trindade wrote: > Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. > > Payne, Jeremyah L (N-CIM) wrote: > > >Good morning, my name is Jeremyah and I am working on a java project to > >interface with some devices. In short, I have a laptop with a PCMIA > >converter that does RS422 running windows 2000. I also will be > >installing some PCI cards into some Linux boxes that will have probably > >4-8 RS422 ports on them. After doing some reading in order to talk > >with these items using my existing java code I will need an additional > >driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > >trying to get a map sort of where I need to make changes. As I see it, > >I would need to subclass SerialPort to my RS422 interface. That would > >link with a DLL or SO implementation that talks with the hardware. I > >also need to change the listing of working ports in the lookup section > >for serial. Does this seem like I am on the right track? Appreciate > >the support. > > > > > >Sincerely, > >Jeremyah Payne > >_______________________________________________ > >Rxtx mailing list > >Rxtx at mail.electronpusher.org > >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 21 13:40:25 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:40:25 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: On Tue, 21 Jun 2005, Payne, Jeremyah L (N-CIM) wrote: > Good morning, my name is Jeremyah and I am working on a java project to > interface with some devices. In short, I have a laptop with a PCMIA > converter that does RS422 running windows 2000. I also will be > installing some PCI cards into some Linux boxes that will have probably > 4-8 RS422 ports on them. After doing some reading in order to talk with > these items using my existing java code I will need an additional > driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > trying to get a map sort of where I need to make changes. As I see it, I > would need to subclass SerialPort to my RS422 interface. That would link > with a DLL or SO implementation that talks with the hardware. I also > need to change the listing of working ports in the lookup section for > serial. Does this seem like I am on the right track? Appreciate the > support. > Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 13:40:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 14:40:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618954@emss02m08.us.lmco.com> I'd like to except I am dealing with NASA. I am basically building a system to monitor 100+ Units that communicate over RS422. They have some converters in place but want to get rid of them. I'll check through the archives. I had started looking yesterday as was leaving work. -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Ricardo Trindade Sent: Tuesday, June 21, 2005 2:25 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From slavelle at atcorp.com Tue Jun 21 14:58:06 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 21 Jun 2005 15:58:06 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: <42B87F5E.4000403@atcorp.com> > Linux has the standard POSIX like baud rates but if you set the baud rate > to B38400, you can set your own baud base and divisor. This is not POSIX > that I know of. W32 has more capability than POSIX like systems too. So > I did some work to have windows work like Linux via termios.c > > But the code is not quit right. SerialImp.c and termios.c need some > work so all the various buadrates work on Linux and W32. Most other > systems will not work beyond what CommAPI already specifies without > writting kernel drivers. > > This is on my todo list but if someone gets to it first, all the better. Hmm, I guess I didn't read this close enough before. Just to be clear, the pieces to setBaudBase and setDivisor are not yet implemented, correct? Thanks, Shawn From sean_montgomery at baseview.com Tue Jun 21 15:14:08 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 21 Jun 2005 17:14:08 -0400 Subject: [Rxtx] OS X installation - file locations Message-ID: <8AB82C7F-0D19-45F9-AE54-A12C59A8495E@baseview.com> Greetings, I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) using the RXTX installation instructions. RXTX worked fine. Basically you've got: - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions - javax.comm.properties in /System/Library/Frameworks/ JavaVM.framework/Home/lib - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ lib/ext My coworker was concerned that the installation required files to be placed in /System/Library... because those directories are "Apple's" and subject to change at Apple's whim, and that it would be safer (less likely to break when a user updates their OS or Java version or what have you) if all the files could be somewhere in /Library... or / Library/Java. My coworker points out that when 3rd party apps like FrontBase and JBoss need to communicate with Java their jars are placed in /Library/Java/Extensions. Granted that RXTX 2.0 is implementing javax.comm and not just a 3rd party extension, might that be the case - that javax.* stuff needs to be in the Java system files? I'm not the Java maven that my coworker is, so I don't know if any of this is gospel or not. Any OS X/Java experts out there willing to comment? We'd like to be able to install RXTX in the safest, most maintenance free way possible, but if there are specific reasons why javax.comm.properties and comm.jar need to be in /System... then so be it. Any information is welcome, Sean From ricardo.trindade at emation.pt Tue Jun 21 15:56:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 22:56:53 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B88D25.7060604@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050621/f6c9f5fe/attachment-0404.html From jeremyah.l.payne at lmco.com Tue Jun 21 15:22:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 16:22:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618955@emss02m08.us.lmco.com> -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Trent Jarvi Sent: Tuesday, June 21, 2005 2:40 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 As of yet we have not decided on the PCI boards to use yet So I am still waiting to se how we will interface to them. But the laptop is ready to use so ill build a test app for that API for now. The overview of class structure is really what I needed. I guess I will use the 2.1 as you suggested. Thanks for the help thus far! BTW, you guys wouldn't happen to keep class diagrams or anything of that nature around would you? If not I will probably end up having to do some anyway for documentation purposes, I could include them. Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From dmarkman at mac.com Tue Jun 21 18:13:28 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 21 Jun 2005 20:13:28 -0400 Subject: [Rxtx] OS X installation - file locations In-Reply-To: References: Message-ID: <044F520C-585C-4B99-82ED-3BA83DB8CE77@mac.com> Apple doesn't recommend to put jars into the /System/Library/Frameworks/JavaVM.framework/Home/lib/ext folder from other hands it's standard java directory to put extentions if you want to support comm api on whole system then I'd recommend to put jars into the /Library/Java/Extensions folder just like you did if you want to support comm api per user put your jars into the ~/ Library/Java/Extensions On Jun 21, 2005, at 5:14 PM, Java RXTX discussion wrote: > Greetings, > > > I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) > using the RXTX installation instructions. RXTX worked fine. > > > Basically you've got: > - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions > - javax.comm.properties in /System/Library/Frameworks/ > JavaVM.framework/Home/lib > - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ > lib/ext > > > My coworker was concerned that the installation required files to be > placed in /System/Library... because those directories are "Apple's" > and subject to change at Apple's whim, and that it would be safer > (less likely to break when a user updates their OS or Java version or > what have you) if all the files could be somewhere in /Library... or / > Library/Java. My coworker points out that when 3rd party apps like > FrontBase and JBoss need to communicate with Java their jars are > placed in /Library/Java/Extensions. Granted that RXTX 2.0 is > implementing javax.comm and not just a 3rd party extension, might > that be the case - that javax.* stuff needs to be in the Java system > files? > > > I'm not the Java maven that my coworker is, so I don't know if any of > this is gospel or not. Any OS X/Java experts out there willing to > comment? We'd like to be able to install RXTX in the safest, most > maintenance free way possible, but if there are specific reasons why > javax.comm.properties and comm.jar need to be in /System... then so > be it. > > > Any information is welcome, > > > Sean > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Dmitry Markman Dmitry Markman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050622/beea65d0/attachment-0404.html From lyon at docjava.com Thu Jun 23 04:39:47 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 23 Jun 2005 06:39:47 -0400 Subject: [Rxtx] web start + RXTX = strange errors? Message-ID: On: Date: Tue, 21 Jun 2005 11:15:53 +0100 From: Jasmine Strong Writes: An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. ----------- I cannot duplicate your error. My version of Java is: java -version java version "1.4.2_05" Is yours the same? Trent: You wrote: passing -source 1.3 -target 1.3 to javac will compile classes without this problem. ----------- OK, I have updated the disto to work with jdk1.3: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Jasmine: Is this working any better? Thanks! - DL From handzisk at tkn.tu-berlin.de Fri Jun 24 02:37:14 2005 From: handzisk at tkn.tu-berlin.de (Vlado Handziski) Date: Fri, 24 Jun 2005 10:37:14 +0200 (CEST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace Message-ID: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Hi all, let me first express my compliments on the great work you have done with the RXTX library. We have been using the library for some time, and we are at a point where we want to make our code public. For legacy reasons, the code that the RXTX library is bundled with, uses the javax.comm namespace. We have been using the ChangePackage script to change the RXTX2.1 package from gnu.io into javax.comm. We need the independent implementation since we want to be able to directly access /dev/ttyUSBx ports in linux and the CommAPI versions are just not as stable. On the download page, there is a comment that this is in violation of sun's license. Can someone shed more light on this. I was not aware that you can protect the names of the java packages. Best regards, Vlado From ricardo.trindade at emation.pt Fri Jun 24 04:01:17 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 11:01:17 +0100 Subject: [Rxtx] parity missed Message-ID: <42BBD9ED.3060004@emation.pt> Hi, I have a "parity missed error". From previous posts I believe this has to do with CMSPAR not being defined. I checked out 2.1 head from CVS. How can I make sure I do a proper build and CMSPAR is defined ? Perhaps it would be good to have a release snapshot that has this, I think the latest snapshot (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. Another question I have, is why must this depend on kernel headers, why can't it be defined in the RXTX source ? thanks Ricardo From jasmine at electronpusher.org Fri Jun 24 04:09:06 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 24 Jun 2005 11:09:06 +0100 Subject: [Rxtx] web start + RXTX = strange errors? In-Reply-To: References: Message-ID: <644aad2bdbba950f0a2fb12d7dcfd8a6@electronpusher.org> On 23 Jun 2005, at 11:39, Dr. Douglas Lyon wrote: > OK, I have updated the disto to work with jdk1.3: > http://show.docjava.com:8086/book/cgij/code/jnlp/ > addbk.JAddressBook.Main.jnlp > > Jasmine: Is this working any better? Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) -J. From taj at www.linux.org.uk Fri Jun 24 10:54:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 17:54:12 +0100 (BST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: On Fri, 24 Jun 2005, Vlado Handziski wrote: > Hi all, > > let me first express my compliments on the great work you have done with > the RXTX library. > > We have been using the library for some time, and we are at a point where > we want to make our code public. For legacy reasons, the code that the > RXTX library is bundled with, uses the javax.comm namespace. We have been > using the ChangePackage script to change the RXTX2.1 package from gnu.io > into javax.comm. We need the independent implementation since we want to > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > versions are just not as stable. > > On the download page, there is a comment that this is in violation of > sun's license. Can someone shed more light on this. I was not aware that > you can protect the names of the java packages. > > Best regards, > Vlado > I can't provide legal advice as I am not a lawyer. (v) may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are contained in the "java", "javax" or "sun" packages or similar as specified by Sun in any class file naming convention; and The license is in the commapi package from Sun. The above is also in all the EULA's you click through to download from Sun if I'm not mistaken. Simply put, the license taints developers that agree to it. For those developers, Sun has control of the javax.comm namespace. It really does not make sense to put rxtx 2.1 in the javax.comm namespace. It will only cause confusion which I think is the point of the clause above. The gnu.io namespace was perhaps a poor choice and just tossed in when reviewing the license to get out of Sun's namespace. There is nothing in the rxtx license limiting your freedom in this fashion though. Many companies are moving to gnu.io and some distribute it with popular applications you would recognize. I'm tempted to ask you not to contaminate rxtx 2.1 with the javax.comm namespace. You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) extensions to existing classes (which I dont think you are using); it is not just javax.comm. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 24 13:24:09 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 20:24:09 +0100 (BST) Subject: [Rxtx] parity missed In-Reply-To: <42BBD9ED.3060004@emation.pt> References: <42BBD9ED.3060004@emation.pt> Message-ID: On Fri, 24 Jun 2005, Ricardo Trindade wrote: > Hi, > > I have a "parity missed error". From previous posts I believe this > has to do with CMSPAR not being defined. > I checked out 2.1 head from CVS. How can I make sure I do a proper > build and CMSPAR is defined ? Perhaps it would be good to have a release > snapshot that has this, I think the latest snapshot > (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. > > Another question I have, is why must this depend on kernel headers, > why can't it be defined in the RXTX source ? > I used to cheat and grab the CMSPAR from the kernel headers because glibc did not have it. Now rxtx uses the glibc headers and we have a patch in glibc I trust that handles this. It would not be right to override glibc and it wasnt right to use the kernel headers (it really did cause problems). You can override glibc for now with the following in the top of SerialImp.c # define CMSPAR 010000000000 You can check if your distro headers have this right bit looking for the above in bits/termios.h. It should look like this: #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif If it is not defined, please file a bug with your distro as rxtx is not the only thing that will be broken on that distro. I was going to release new cvs snapshots last weekend but got tied up. I'll do it this weekend. I also need to get custom baudrate patches into the cvs snapshot. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Fri Jun 24 13:56:50 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 20:56:50 +0100 Subject: [Rxtx] parity missed In-Reply-To: References: <42BBD9ED.3060004@emation.pt> Message-ID: <42BC6582.2070805@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050624/e3b39631/attachment-0404.html From vlado.handziski at gmail.com Sat Jun 25 06:25:52 2005 From: vlado.handziski at gmail.com (Vlado Handziski) Date: Sat, 25 Jun 2005 14:25:52 +0200 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: <697986ec05062505256ebf381f@mail.gmail.com> Thanks for the clarification. Since changing the bundled source is not an option at this moment, we will consider using javax.comm and RXTX2.0. In the next rewrite, we would probably move to gnu.io . Best regards, Vlado Handziski On 6/24/05, Trent Jarvi wrote: > > On Fri, 24 Jun 2005, Vlado Handziski wrote: > > > Hi all, > > > > let me first express my compliments on the great work you have done with > > the RXTX library. > > > > We have been using the library for some time, and we are at a point > where > > we want to make our code public. For legacy reasons, the code that the > > RXTX library is bundled with, uses the javax.comm namespace. We have > been > > using the ChangePackage script to change the RXTX2.1 package from gnu.io > > into javax.comm. We need the independent implementation since we want to > > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > > versions are just not as stable. > > > > On the download page, there is a comment that this is in violation of > > sun's license. Can someone shed more light on this. I was not aware that > > you can protect the names of the java packages. > > > > Best regards, > > Vlado > > > > I can't provide legal advice as I am not a lawyer. > > (v) may not create, or authorize your licensees to create additional > classes, interfaces, or subpackages that are contained in the "java", > "javax" or "sun" packages or similar as specified by Sun in any class file > naming convention; and > > The license is in the commapi package from Sun. The above is also in all > the EULA's you click through to download from Sun if I'm not mistaken. > > Simply put, the license taints developers that agree to it. For those > developers, Sun has control of the javax.comm namespace. > > It really does not make sense to put rxtx 2.1 in the javax.comm namespace. > It will only cause confusion which I think is the point of the clause > above. The gnu.io namespace was perhaps a poor choice and > just tossed in > when reviewing the license to get out of Sun's namespace. > > There is nothing in the rxtx license limiting your freedom in this fashion > though. Many companies are moving to gnu.io and some > distribute it with > popular applications you would recognize. I'm tempted to ask you not > to contaminate rxtx 2.1 with the javax.comm namespace. > > You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm > using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) > extensions to existing classes (which I dont think you are using); it is > not just javax.comm. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050625/1dadc50e/attachment-0404.html From taj at www.linux.org.uk Sun Jun 26 11:34:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 26 Jun 2005 18:34:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. Message-ID: The attached file should fix baud_base and divisor extensions for Linux The patch is against rxtx 2.1 CVS HEAD. To use this patch, you should set the baud rate to 38400. You can then try SerialPort.setBaudBase(int) and SerialPort.setDivisor(int) There are matching int SerialPort.getBaudBase() and int SerialPort.getDivisor(). What baud bases are available depends upon the serial port card and its driver so this is a bit of a blind attempt on my part. I've looked at the w32 API and I dont see anything available yet. The w32 code in RXTX will probably be figuring out the baud rate based on the tried baud base and divisor and just slamming it at the API for now (the API does something with that but I've not found real documentation on what it does). I dont want to try tinkering with the UART directly yet as that would involve poking machine memory directly and could very easily be error prone in bad ways. I don't expect Solaris or any SysV UNIX systems to work at all with this - ever. It is not standard in any way and will throw Exceptions on everything but Linux (w32 will just fail miserably as it is 1/2 implemented). If anyone has looked at custom baud rates before and has some thoughts or just wants to try the attached untested patch, I'd appreciate any feedback. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- ? autom4te.cache ? build ? output cvs server: Diffing . Index: configure =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure,v retrieving revision 1.35.2.59 diff -u -r1.35.2.59 configure --- configure 16 Oct 2004 16:20:34 -0000 1.35.2.59 +++ configure 26 Jun 2005 16:59:28 -0000 @@ -9644,6 +9644,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { #if defined (__GLIBC__) @@ -9782,6 +9784,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { @@ -9825,7 +9829,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -9837,7 +9841,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 26 Jun 2005 16:59:28 -0000 @@ -218,6 +218,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { #if defined (__GLIBC__) @@ -356,6 +358,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { @@ -399,7 +403,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -411,7 +415,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" cvs server: Diffing CNI cvs server: Diffing MACOSX_IDE cvs server: Diffing MACOSX_IDE/CW cvs server: Diffing MACOSX_IDE/ForPackageMaker cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions cvs server: Diffing MACOSX_IDE/ForPackageMaker/Resources cvs server: Diffing MACOSX_IDE/PB cvs server: Diffing WinCE cvs server: Diffing contrib cvs server: Diffing debian cvs server: Diffing src Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 26 Jun 2005 16:59:29 -0000 @@ -2079,15 +2079,17 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int BaudBase The clock frequency divided by 16. Default * BaudBase is 115200. * @return boolean true on success - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:setBaudBase()"); @@ -2097,10 +2099,11 @@ /** * Extension to CommAPI * @return int BaudBase - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getBaudBase() throws UnsupportedCommOperationException + public int getBaudBase() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getBaudBase()"); @@ -2108,13 +2111,14 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, IOException { if ( debug ) z.reportln( "RXTXPort:setDivisor()"); @@ -2124,10 +2128,11 @@ /** * Extension to CommAPI * @returns int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getDivisor() throws UnsupportedCommOperationException + public int getDivisor() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getDivisor()"); Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 26 Jun 2005 16:59:30 -0000 @@ -1877,16 +1877,27 @@ int fd = get_java_var( env, jobj,"fd","I" ); struct serial_struct sstruct; + if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) + { + goto fail; + } + + sstruct.baud_base = (int) BaudBase; + if ( sstruct.baud_base < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetBaudBase", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetBaudBase", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1914,9 +1925,13 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) ( sstruct.baud_base ) ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetBaudBase", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetBaudBase", strerror( errno ) ); @@ -1950,19 +1965,23 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } if ( sstruct.custom_divisor < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetDivisor", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetDivisor", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1971,7 +1990,7 @@ accept: none perform: Find the Divisor used for custom speeds - return: Divisor + return: Divisor negative value on error. exceptions: Unsupported Comm Operation on systems not supporting TIOCGSERIAL comments: @@ -1990,10 +2009,14 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) sstruct.custom_divisor ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetDivisor", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetDivisor", strerror( errno ) ); @@ -2032,7 +2055,7 @@ /* Open and lock the port so nothing else changes the setting */ - if ( LOCK( filename, pid ) ) goto fail;; + if ( LOCK( filename, pid ) ) goto fail; fd = find_preopened_ports( filename ); if( !fd ) Index: src/SerialPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/Attic/SerialPort.java,v retrieving revision 1.3.2.9 diff -u -r1.3.2.9 SerialPort.java --- src/SerialPort.java 12 Oct 2004 08:59:28 -0000 1.3.2.9 +++ src/SerialPort.java 26 Jun 2005 16:59:30 -0000 @@ -103,13 +103,17 @@ public abstract String getUARTType() throws UnsupportedCommOperationException; public abstract boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getBaudBase() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getDivisor() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setLowLatency() throws UnsupportedCommOperationException; public abstract boolean getLowLatency() cvs server: Diffing src/lfd cvs server: Diffing src/psmisc From uwe at kubosch.no Mon Jun 27 14:13:57 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Mon, 27 Jun 2005 22:13:57 +0200 Subject: [Rxtx] RXTX on FC4 Message-ID: <1119903238.2989.27.camel@BPC0276> Hi all! I just got RXTX to work on Fedora Core 4. The standard download did not work. I had to check the code out from CVS and build it, but then it worked flawlessly. Thanks for your good work. Now I wonder if I should contribute the compiled files so that others will have an easier time than me getting RXTX to work on FC4. What do I do? Who do I talk to? donV From taj at www.linux.org.uk Mon Jun 27 14:29:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 27 Jun 2005 21:29:46 +0100 (BST) Subject: [Rxtx] RXTX on FC4 In-Reply-To: <1119903238.2989.27.camel@BPC0276> References: <1119903238.2989.27.camel@BPC0276> Message-ID: On Mon, 27 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I just got RXTX to work on Fedora Core 4. > > The standard download did not work. > > I had to check the code out from CVS and build it, but then it worked > flawlessly. > > Thanks for your good work. > > Now I wonder if I should contribute the compiled files so that others > will have an easier time than me getting RXTX to work on FC4. What do I > do? Who do I talk to? > > The best thing to do with FC is to contibute an extras RPM. Debian does something like this with their .deb packaging. As rxtx is OS neutral, it is almost impossible to have everything on rxtx.org. If you do get a package in Fedora Extras, I can point a link there. The extra's mail list is here: https://www.redhat.com/mailman/listinfo/fedora-extras-list If it would help to have me release a 'stable' .tar.gz of the source for the RPM submittal process I can do that. It would also trigger upgrades in debian which would not be bad. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Mon Jun 27 16:23:20 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 27 Jun 2005 17:23:20 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: Message-ID: <42C07C58.1030608@atcorp.com> Hey Trent, I installed it and now I get IOExceptions instead of the other one. I'm not sure how those changes would have enabled setDivisor and setBaudBase to work though. Is it significant that this is a USB device emulating a serial port? ~ Shawn From taj at www.linux.org.uk Mon Jun 27 18:07:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 01:07:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: <42C07C58.1030608@atcorp.com> References: <42C07C58.1030608@atcorp.com> Message-ID: On Mon, 27 Jun 2005, Shawn Lavelle wrote: > Hey Trent, > I installed it and now I get IOExceptions instead of the other one. > I'm not sure how those changes would have enabled setDivisor and > setBaudBase to work though. Is it significant that this is a USB device > emulating a serial port? > The USB driver probably does not support this. With USB, the ioctl()'s appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through the linux drivers/usb tree and found to ioctl to support this in Linux 2.6.10. RXTX is not doing very much magic, the patch really only gets the serial struct instead of writing a structure with random values for baudbase and handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel level driver issue not a user space library issue. So if you wanted this to work, the usb serial driver would have to handle the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression after looking through the USB tree quickly. I hope that helps. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Jun 27 18:25:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 27 Jun 2005 20:25:22 -0400 Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) Message-ID: Hi All, I wrote: Jasmine: Is this working any better? And Jasmine says: Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) I am using -source 1.3 and -target 1.3 for the compilation, however, we still seem to have this problem, which my machine (for some reason) does not have. Does anyone have any ideas about what might be the problem? Thanks! - DL From taj at www.linux.org.uk Mon Jun 27 19:04:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 02:04:37 +0100 (BST) Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) In-Reply-To: References: Message-ID: On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I wrote: > Jasmine: Is this working any better? > > And Jasmine says: > Nope. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > > I am using -source 1.3 and -target 1.3 > for the compilation, however, we still seem to have this problem, > which my machine (for some reason) does not have. > Does anyone have any ideas about what might be the problem? > This has shown up in the past with jdk 1.5 compiled jars running on jre 1.4 machines. My guess is either jasmine has an old copy of rxtx with the problem on her machine that is being picked up on the classpath or you have not tried this with jre 1.4. The suggested -source/target fix should avoid the problem. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Mon Jun 27 21:23:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 04:23:55 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: On Tue, 28 Jun 2005, Trent Jarvi wrote: > On Mon, 27 Jun 2005, Shawn Lavelle wrote: > > > Hey Trent, > > I installed it and now I get IOExceptions instead of the other one. > > I'm not sure how those changes would have enabled setDivisor and > > setBaudBase to work though. Is it significant that this is a USB device > > emulating a serial port? > > > > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > > RXTX is not doing very much magic, the patch really only gets the serial > struct instead of writing a structure with random values for baudbase and > handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel > level driver issue not a user space library issue. > > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. > > I hope that helps. > > > It may be possible that you can just modify translate_speed and get_java_baudrate in SerialImp.c to have the new high speds you are after. The defines are in /usr/include/termios.h. #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 You can see many of these are not handled. I dont think CommAPI handled more than 57600 or so. int get_java_baudrate( int native_speed ) { switch( native_speed ) { case B0: return 0; case B50: return 50; case B75: return 75; case B110: return 110; case B134: return 134; case B150: return 150; case B200: return 200; case B300: return 300; case B600: return 600; case B1200: return 1200; case B1800: return 1800; case B2400: return 2400; case B4800: return 4800; case B9600: return 9600; case B19200: return 19200; case B38400: return 38400; case B57600: return 57600; default: return -1; } } int translate_speed( JNIEnv *env, jint speed ) { LEAVE( "RXTXPort:translate_speed" ); switch( speed ) { case 0: return B0; case 50: return B50; case 75: return B75; case 110: return B110; case 134: return B134; case 150: return B150; case 200: return B200; case 300: return B300; case 600: return B600; case 1200: return B1200; case 1800: return B1800; case 2400: return B2400; case 4800: return B4800; case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; #ifdef B57600 case 57600: return B57600; #endif /* B57600 */ #ifdef B115200 case 115200: return B115200; #endif /* B115200 */ #ifdef B230400 case 230400: return B230400; #endif /* B230400 */ #ifdef B460800 case 460800: return B460800; #endif /* B460800 */ #ifdef B14400 case 14400: return B14400; #endif /* B14400 */ #ifdef B28800 case 28800: return B28800; #endif /* B28800 */ #ifdef B128000 /* dima */ case 128000: return B128000; #endif /* dima */ #ifdef B256000 /* dima */ case 256000: return B256000; #endif /* dima */ } /* Handle custom speeds */ if( speed >= 0 ) return speed; else { LEAVE( "RXTXPort:translate_speed: Error condition" ); return -1; } } -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 28 05:20:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 28 Jun 2005 07:20:21 -0400 Subject: [Rxtx] cross-compilation using Make for Mac Message-ID: Hi All, Please excuse the long post; Trent said: >" >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. " Here is what I have on the mac version: java -version java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) When I run: http://show.docjava.com:8086/book/cgij/code/jnlp/math.benchmarks.Dhry.jnlp I get: -- listing properties -- jnlpx.heapsize=NULL,NULL jnlpx.splashport=-1 java.runtime.name=Java(TM) 2 Runtime Environment, Stand... java.protocol.handler.pkgs=com.sun.javaws.net.protocol sun.boot.library.path=/System/Library/Frameworks/JavaVM.fra... java.vm.version=1.4.2-38 awt.nativeDoubleBuffering=true gopherProxySet=false http.auth.serializeRequests=true java.vm.vendor="Apple Computer, Inc." java.vendor.url=http://apple.com/ path.separator=: java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io jnlpx.home=/Applications/Utilities/Java/Java Web... user.country=US sun.os.patch.level=unknown java.vm.specification.name=Java Virtual Machine Specification user.dir=/ java.runtime.version=1.4.2_05-141.4 java.awt.graphicsenv=apple.awt.CGraphicsEnvironment java.endorsed.dirs=/System/Library/Frameworks/JavaVM.fra... os.arch=ppc java.io.tmpdir=/tmp line.separator= java.vm.specification.vendor=Sun Microsystems Inc. jnlpx.remove=false os.name=Mac OS X sun.java2d.fontpath= java.library.path=/Applications/Utilities/Java/Java Web... java.specification.name=Java Platform API Specification java.class.version=48.0 jnlpx.deployment.user.home=/Users/lyon/Library/Caches/Java Web S... java.util.prefs.PreferencesFactory=java.util.prefs.MacOSXPreferencesFactory os.version=10.3.9 user.home=/Users/lyon user.timezone=America/New_York java.security.policy=file:/Applications/Utilities/Java/Jav... java.awt.printerjob=apple.awt.CPrinterJob trustProxy=true java.specification.version=1.4 file.encoding=MacRoman jnlpx.deployment.system.home=/Applications/Utilities/Java/J2SE 5.0... user.name=lyon java.class.path=/Applications/Utilities/Java/Java Web... java.vm.specification.version=1.0 sun.arch.data.model=32 java.home=/System/Library/Frameworks/JavaVM.fra... java.specification.vendor=Sun Microsystems Inc. user.language=en awt.toolkit=apple.awt.CToolkit java.vm.info=mixed mode java.version=1.4.2_05 java.ext.dirs=/Users/lyon/Library/Java/Extensions:/... sun.boot.class.path=/System/Library/Frameworks/JavaVM.fra... java.vendor=Apple Computer, Inc. file.separator=/ java.vendor.url.bug=http://developer.apple.com/java/ sun.cpu.endian=big sun.io.unicode.encoding=UnicodeBig mrj.version=141.3 jnlpx.jvm=/System/Library/Frameworks/JavaVM.fra... sun.cpu.isalist= sun.awt.exception.handler=apple.awt.CToolkit$EventQueueExceptio... javawebstart.version=javaws-1.4.2_05 800 mhz g4,878k ds/sec total time: 1184ms Result: 844594 dhrystone/sec. Load average for last 15 minutes:0.62 So, I feel pretty sure that I have tried this with 1.4. As to modifying the RXTX compilation, that I did not do...and I take your point. I have been using the binary distributions as is. Oops. I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Now when I do a make, I get: make gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known libtool: link: warning: undefined symbols not allowed in i386-pc-mingw32 shared libraries rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ln: `SerialImp.o': File exists make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 So, I do a make clean, then a make: .... (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ar cru .libs/librxtxSerial.a /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o ar: /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o: No such file or directory make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 In the i386 directory, there is a symbolic link left from something: ls -al SerialImp.o lrwxrwxrwx 1 lyon lyon 12 Jun 28 07:03 SerialImp.o -> SerialImp.lo However, the SerialImp.lo is not present (which is the cause of the error, I think). On the other hand, the file I am looking for is present in: i686-pc-linux-gnu Possibly the i386 generation is not clean (of course it is also likely that I am just asking dumb questions, being a newbie to the code and all.). Finally, will this make file regenerate the distro for the mac? I found some really old (from year 2001) files in: cvs/MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions Which I could use for the distro...but I would prefer to do a clean, multi-platform build from make. Thanks! - Doug >On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > >> Hi All, >> I wrote: >> Jasmine: Is this working any better? >> >> And Jasmine says: >> Nope. >> >> An error occurred while launching/running the application. >> >> Title: addbk.JAddressBook.Main >> Vendor: DocJava, Inc. >> Category: Unexpected Error >> >> gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) >> >> > > I am using -source 1.3 and -target 1.3 >> for the compilation, however, we still seem to have this problem, >> which my machine (for some reason) does not have. >> Does anyone have any ideas about what might be the problem? >> > >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. > > >The suggested -source/target fix should avoid the problem. > >-- >Trent Jarvi >tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 28 09:43:41 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 28 Jun 2005 10:43:41 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: <42C1702D.1070307@atcorp.com> > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. There is ioctl stuff in the driver for the chip, but i haven't seen the TIOC*SERIAL entries. That might be why it continues to fail. I did get around the problem, though, by hacking the driver and just specifying the baud rate I need. Now everything works well. Thanks for all the assistance you've provided. ~ Shawn M. Lavelle From taj at www.linux.org.uk Tue Jun 28 12:42:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:42:29 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known Add a compiler flag -DWIN32 The code above should not be compiling on w32 as it is #if !defined(WIN32) You can look at the bottom of Makefile.in to see the w32 compile flags. Search for "WIN32 CrossCompiling from here down" If its still not working, I can set you up with the Bob account. Just email me off the list. W32 compiling is a bit complicated. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 28 12:52:50 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:52:50 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Nods. I did change configure but right now it is only in the baudbase/divisor patch I posted. I'm going to add several extension baud rates that can be supported by normal API calls and commit that today as a followup to my comments yesterday on baudrates. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Wed Jun 29 01:52:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 08:52:10 +0100 (BST) Subject: [Rxtx] [PATCH] More baud rate fixes Message-ID: I went through the native baudrate conversion from Java and added several. This patch is against CVS 2.1 head. I think thats it for baud rate fixes unless someone see something. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- A non-text attachment was scrubbed... Name: baud_base_and_divisor_plus_odd_baudrates.diff.gz Type: application/x-gzip Size: 3291 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050629/4c1ef1c2/baud_base_and_divisor_plus_odd_baudrates.diff-0404.gz From lyon at docjava.com Wed Jun 29 10:33:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 29 Jun 2005 12:33:45 -0400 Subject: [Rxtx] java.comm dependencies Message-ID: Hi All, During a build of the rxtx code, I have left the javax.comm out of the system (on purpose). However, I get an error, at run time: CommPortIdentifier:static initialization() apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: javax/comm/CommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver I am thinking that there is something in the gnu.io.CommPortIdentifier that seeks to load the javax.comm.CommDriver. It was my understanding that we could write code without reference to the javax.comm.CommDriver and that we could work in the gnu namespace. Is this true? Thanks! - Doug From taj at www.linux.org.uk Wed Jun 29 11:16:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 18:16:08 +0100 (BST) Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > During a build of the rxtx code, I have left the > javax.comm out of the system (on purpose). > However, I get an error, at run time: > > CommPortIdentifier:static initialization() > apple.awt.EventQueueExceptionHandler Caught Throwable : > java.lang.NoClassDefFoundError: javax/comm/CommDriver > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > that seeks to load the javax.comm.CommDriver. > > It was my understanding that we could write code without reference > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > Is this true? > Yes. People use 2.1 without javax all the time. There should be no reference to javax at all in rxtx 2.1. You may check your code. I just did a grep through 2.1 and there is nothing. You may look at the classes you are using. If you find javax.comm in your code, replace it with gnu.io and that should be all you need to do. -- Trent Jarvi tjarvi at qbang.org From jayant28k at gmail.com Wed Jun 29 21:49:28 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Thu, 30 Jun 2005 09:19:28 +0530 Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: <6a6a02310506292049778c452f@mail.gmail.com> Trent, I think best idea is to have wiki for rxtx code. So as the traffic is increasing with time. "RXTX" seems to be more popular in embbeded system. Sun Microsystems will always apperciate your efforts on parallel and serial ports commincation based application in IT Industry. Thanks for your help on this forum as "ONE MAN ARMY" ;-) Cheers, Jayant On 6/29/05, Trent Jarvi wrote: > On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > > > Hi All, > > During a build of the rxtx code, I have left the > > javax.comm out of the system (on purpose). > > However, I get an error, at run time: > > > > CommPortIdentifier:static initialization() > > apple.awt.EventQueueExceptionHandler Caught Throwable : > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > > that seeks to load the javax.comm.CommDriver. > > > > It was my understanding that we could write code without reference > > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > > > Is this true? > > > > Yes. People use 2.1 without javax all the time. > > There should be no reference to javax at all in rxtx 2.1. You may check > your code. I just did a grep through 2.1 and there is nothing. You may > look at the classes you are using. > > If you find javax.comm in your code, replace it with gnu.io and that > should be all you need to do. > > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From uwe at kubosch.no Sat Jun 25 02:50:24 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Sat, 25 Jun 2005 10:50:24 +0200 Subject: [Rxtx] RXTX in FC3/FC4 Message-ID: <1119689424.12606.14.camel@BPC0276> Hi all! I am trying to get RXTX to work on Fedora Core, version 3 or 4. I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext directory. I have edited the jre/lib/javax.comm.properties according to the docs. I have tried this with both rxtx 2.0 and 2.1. I have tried on two different machines. I have tried with java 1.4.2 and java 1.5.0, both from Sun. I always get a signall 11 from the native libraries when they are loaded. Is this a common problem? Any help is greatly appreciated. Below is the start of the error message. More can be supplied on demand. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x65015A Function=(null)+0x65015A Library=/lib/ld-linux.so.2 NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) - locked <0xed46f628> (a java.util.Vector) - locked <0xed471708> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xed46ebc0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.InitializeDriver(CommPortIdentifier.java:213) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:248) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:351) at com.jpeterson.x10.module.CM11A.allocate(CM11A.java:1160) at net.sourceforge.cruisecontrol.publishers.X10Publisher.send(X10Publisher.java:182) at net.sourceforge.cruisecontrol.publishers.X10Publisher.turnOff(X10Publisher.java:171) at net.sourceforge.cruisecontrol.publishers.X10Publisher.handleBuild(X10Publisher.java:148) at net.sourceforge.cruisecontrol.publishers.X10Publisher.publish(X10Publisher.java:141) at net.sourceforge.cruisecontrol.Project.publish(Project.java:679) at net.sourceforge.cruisecontrol.Project.build(Project.java:227) at net.sourceforge.cruisecontrol.Project.execute(Project.java:153) at net.sourceforge.cruisecontrol.ProjectWrapper.run(ProjectWrapper.java:66) at java.lang.Thread.run(Thread.java:534) From chris_jh at blueyonder.co.uk Tue Jun 28 05:37:10 2005 From: chris_jh at blueyonder.co.uk (Christopher Harris) Date: Tue, 28 Jun 2005 12:37:10 +0100 Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError Message-ID: <42C13666.9030108@blueyonder.co.uk> Hi I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 32bit) The serial ports work fine with no issues, but when i try to use the parallel port i get this message Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:66) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) I am trying to print a line out to port "/dev/lp0" At first i thought it could not find the librxtxParallel.so file, but when i renamed it i got a different saying it could not find the library. I have tried to run as root no difference. It is really weird, i get no compile errors and the serial ports work fine. I changed the LPRPort.java and commented out the Initialize call method. And just get the same error but for the method open. It is as though it can't see the methods, and yet it can see the library. I did have a bit of check of the JNI implementation in rxtx but could not spot anything. Yours Thankfully Christopher Harris From lyon at docjava.com Thu Jun 30 02:28:09 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 04:28:09 -0400 Subject: [Rxtx] tools Message-ID: Hi All, I have been thinking about automatic cross-platform native method development of Java/C programs. It appears that different binary tools are needed to target different platforms. Configuration seems a bit painful. Is there something better available than make? Is ANT any good at this? Has anyone tried: http://jnipp.sourceforge.net/ Thanks! - Doug From lyon at docjava.com Thu Jun 30 04:11:17 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 06:11:17 -0400 Subject: [Rxtx] javax.comm Message-ID: Hi All, When I load my jar files on a linux box, all is well. However, when I load them on a mac, I get: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver The jar files for the mac are different from the jar files for linux, because recompilation of the native code for the mac has not been easy, for me. As a result, the RXTX jars are tending toward specific versions and platforms. Probably, this is not an ideal situation, but, I suspect, it is common. I have an idea that we could create a single JNLP distro site that we can make reference to that would enable a uniform repository of synchronized signed native methods and jars for RXTX. For example, the one-wire Maxim folks have a real-nice approach where their stuff makes reference to another JNLP file that contains all the stuff we need to make RXTX work. Check it out at: http://www.maxim-ic.com/products/ibutton/software/1wire/OneWireViewer.cfm However, even they have problems on an unconfigured machine: Specified adapter name "DS9097U" is not known * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cannot load default adapter. Please check that the adapter is connected and that no other application is using the port. If you have checked the adapter, the default port might not be selected. Either set the value of the TMEX default using the utility provided with the TMEX Runtime, or create a new file in the /lib folder called onewireviewer.properties with two lines, similar to the following: #native win32 drivers adapter.name={DS9097U} adapter.port=COM1 #or javax.comm drivers adapter.name=DS9097U adapter.port=COM1 The full path to this file should be: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/onewireviewer.properties ---- Wow, that is a show stopper! Configuration is something that we really need to think about as an automatic thing, particularly for web start users. You can't ask a person who wants to run an application to figure out how to alter a properties file. If you know you need one, then get permission and make one...automatically. That makes a lot of sense, to me. Basically, we need an installer. At the very least, all the pre-built binaries and jars needed for the RXTX package on several platforms should be available from a single place. One this happens, we can make a JNLP file that is platform specific, but can give us a level of indirection. Is this something that has been done already? Thanks! - Doug From taj at www.linux.org.uk Thu Jun 30 08:10:22 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 15:10:22 +0100 (BST) Subject: [Rxtx] tools In-Reply-To: References: Message-ID: On Thu, 30 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I have been thinking about automatic cross-platform > native method development of Java/C programs. > > It appears that different binary tools are needed to target different > platforms. Configuration seems a bit painful. > > Is there something better available than make? > > Is ANT any good at this? I'm far from an Ant expert but have used it for other projects. The main problem I see with ant is there is no mainstream support for platform neutral neutral library creation as far as I can tell. I think ant is a fine replacement for make but I've not seen a suitable replacement for autoconf. At that point, make is as good as anything. It should be possible to create a ant build.xml that works on say Solaris, Linux, Windows and Mac OS X. The problem is when you are trying to build a library for embeded ARM from Mac OS X. > Has anyone tried: > http://jnipp.sourceforge.net/ -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:22:02 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:22:02 +0100 (BST) Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <1119689424.12606.14.camel@BPC0276> References: <1119689424.12606.14.camel@BPC0276> Message-ID: On Sat, 25 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I am trying to get RXTX to work on Fedora Core, version 3 or 4. > > I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 > directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext > directory. > > I have edited the jre/lib/javax.comm.properties according to the docs. > > I have tried this with both rxtx 2.0 and 2.1. > > I have tried on two different machines. > > I have tried with java 1.4.2 and java 1.5.0, both from Sun. > > I always get a signall 11 from the native libraries when they are > loaded. Is this a common problem? Any help is greatly appreciated. > Below is the start of the error message. More can be supplied on > demand. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x65015A > Function=(null)+0x65015A > Library=/lib/ld-linux.so.2 > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) If you compile rxtx from source, this will probably go away. I'm not sure what the exact cause is but it looks like the binaries are not suitable for FC3/4. The ABI may have changed since those had been compiled. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:26:56 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:26:56 +0100 (BST) Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError In-Reply-To: <42C13666.9030108@blueyonder.co.uk> References: <42C13666.9030108@blueyonder.co.uk> Message-ID: tOn Tue, 28 Jun 2005, Christopher Harris wrote: > Hi > > I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 > 32bit) > > The serial ports work fine with no issues, but when i try to use the > parallel port i get this message > > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:66) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) > > > I am trying to print a line out to port "/dev/lp0" > > At first i thought it could not find the librxtxParallel.so file, but > when i renamed it i got a different saying it could not find the library. > > I have tried to run as root no difference. > > It is really weird, i get no compile errors and the serial ports work fine. > > I changed the LPRPort.java and commented out the Initialize call method. > And just get the same error but for the method open. > > It is as though it can't see the methods, and yet it can see the library. > I did have a bit of check of the JNI implementation in rxtx but could > not spot anything. > > > You can check if the symbols are in the shared library: nm librxtxSerial.so |grep Initialize If the symbols are not there, there was a build error. Watch very close for build errors while compiling from source. I suspect something isnt behaving right. -- Trent Jarvi tjarvi at qbang.org From allen at adbyrne.us Thu Jun 30 06:55:58 2005 From: allen at adbyrne.us (Allen Byrne) Date: Thu, 30 Jun 2005 07:55:58 -0500 Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> References: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> Message-ID: <200506300755.59159.allen@adbyrne.us> On Thursday 30 June 2005 00:31, rxtx-request at mail.electronpusher.org wrote: > >Message: 8 >Date: Sat, 25 Jun 2005 10:50:24 +0200 >From: Uwe Kubosch >Subject: [Rxtx] RXTX in FC3/FC4 >To: rxtx at mail.electronpusher.org >Message-ID: <1119689424.12606.14.camel at BPC0276> >Content-Type: text/plain > >Hi all! > >I am trying to get RXTX to work on Fedora Core, version 3 or 4. > >I have tried this with both rxtx 2.0 and 2.1. > >I have tried on two different machines. > >I have tried with java 1.4.2 and java 1.5.0, both from Sun. > >I always get a signall 11 from the native libraries when they are >loaded. ?Is this a common problem? ?Any help is greatly appreciated. >Below is the start of the error message. ?More can be supplied on >demand. > >An unexpected exception has been detected in native code outside the VM. >Unexpected Signal : 11 occurred at PC=0x65015A >Function=(null)+0x65015A >Library=/lib/ld-linux.so.2 > I had thi same problem on SUSE9.3 and java 1.5.0. After searching through the archives, I found a patch that required adding a sleep(1000) command in two functions of SerialIO.java. This only was for rxtx2.1, I had no trouble with rxtx2.0. Note, also I had to add the "|1.5*" sequence to the configure.in file to get good *.so libs. Again 2.0 was fine. -- Allen Byrne adbyrne at ieee.org http://modelrr.adbyrne.us From taj at www.linux.org.uk Fri Jun 3 01:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 08:57:29 +0100 (BST) Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 3 09:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 16:57:53 +0100 (BST) Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi at qbang.org From jasmine at electronpusher.org Fri Jun 3 10:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 17:12:21 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 11:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:02:09 +0100 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 11:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:05:10 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From jon.nall at gmail.com Mon Jun 6 09:13:58 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 10:13:58 -0500 Subject: [Rxtx] StackOverflowError Message-ID: I have a fairly small application that is communicating to a microcontroller programmer at 115.2k. I have a test where I try and dump the memory of the microcontroller (whose size is 8k and change). Things are going smoothly and the data looks good. Then after reading out ~6.5k of data, I get a StackOverflowError. The stack trace looks like: CommInterface.serialEvent(): 324 // this is my code RXTXPort.sendEvent(): 732 RXTXPort.eventLoop() [Native] MonitorThread.run(): 1531 I am running on windows and using rxtx-2.1-CVS-20050120. When I increased the stack size to 512k, I could read the entire chip without issue. But that doesn't seem like the right thing to do without root causing what's happening. My code doesn't include any recursion and the stack trace looks terribly short, so I'm a bit confused as to why I'm getting a StackOverflowError. CommInterface.serialEvent() does little more than grab the available bytes, enter a synchronized block, stick them in a common data area for the main thread to use and leave the synchronization block. I guess my question is: are there any known issues with the default stack size when using the latest rxtx on windows? thanks, nall. From taj at www.linux.org.uk Mon Jun 6 09:27:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 16:27:34 +0100 (BST) Subject: [Rxtx] StackOverflowError In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > I have a fairly small application that is communicating to a > microcontroller programmer at 115.2k. I have a test where I try and > dump the memory of the microcontroller (whose size is 8k and change). > Things are going smoothly and the data looks good. Then after reading > out ~6.5k of data, I get a StackOverflowError. The stack trace looks > like: > > CommInterface.serialEvent(): 324 // this is my code > RXTXPort.sendEvent(): 732 > RXTXPort.eventLoop() [Native] > MonitorThread.run(): 1531 > > I am running on windows and using rxtx-2.1-CVS-20050120. When I > increased the stack size to 512k, I could read the entire chip without > issue. But that doesn't seem like the right thing to do without root > causing what's happening. My code doesn't include any recursion and > the stack trace looks terribly short, so I'm a bit confused as to why > I'm getting a StackOverflowError. > > CommInterface.serialEvent() does little more than grab the available > bytes, enter a synchronized block, stick them in a common data area > for the main thread to use and leave the synchronization block. > > I guess my question is: are there any known issues with the default > stack size when using the latest rxtx on windows? > This is the first I've heard of the problem. It is strange as you mention lookin at the stack trace. That cant be taking up too much space. If you just toss the data instead of trying to put it in your work area, does it persist? -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Mon Jun 6 10:09:39 2005 From: lengyel at gmail.com (FL) Date: Mon, 6 Jun 2005 12:09:39 -0400 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on which the jdk1.5.0_03 is installed. I found that the INSTALL documentation seems to be in error. It states that javacomm20-x86.tar.Z (the Java Communications API for Solaris/x86) must be used, in fact this choice led to the following test with theBlackBox sample program in the commapi: root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG BlackBox -p /dev/ttyS0 Port /dev/ttyS0 not found! No serial ports found! Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to cause Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to the Eclipse stable build version 3.1M7 to avoid this. However, I found that using the Solaris/Sparc version of commapi worked on my system. I have documented this on: http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050606/b28fb9a7/attachment.html From taj at www.linux.org.uk Mon Jun 6 10:30:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:30:27 +0100 (BST) Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, FL wrote: > I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on > which the jdk1.5.0_03 is installed. I found that the INSTALL documentation > seems to be in error. It states that javacomm20-x86.tar.Z (the Java > Communications API for Solaris/x86) must be used, in fact this choice led to > the following test with theBlackBox sample program in the commapi: > > root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG > BlackBox -p /dev/ttyS0 > Port /dev/ttyS0 not found! > No serial ports found! > > Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to > cause > Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to > the Eclipse stable build version 3.1M7 to avoid this. > > However, I found that using the Solaris/Sparc version of commapi > worked on my system. > > I have documented this on: > > http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 > Thanks FL. I'll change the documentation to point to the SPARC comm.jar. In the past, any Solaris was good enough, we tried to avoid the w32 comm.jar because it made native calls rxtx would never implement on any OS as they are not platform neutral. I'll withold comments about Sun's comm.jar being different on various CPUs within even the same OS. RXTX 2.1 does not need to do that even acrossed OSs for instance. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 6 10:35:43 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 11:35:43 -0500 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API Message-ID: It seems that Sun's javax.comm site does not include JavaDoc'ed API and the RxTx site has the API, but no real documentation. Is there some site that i'm just missing in my google searches? I'm looking for a copy of the javax.comm API which is documented. Thanks, nall. From taj at www.linux.org.uk Mon Jun 6 10:44:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:44:03 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > It seems that Sun's javax.comm site does not include JavaDoc'ed API > and the RxTx site has the API, but no real documentation. Is there > some site that i'm just missing in my google searches? I'm looking for > a copy of the javax.comm API which is documented. > > Thanks, > nall. Sun's version is with their binary downloads. RXTX tries to match that so I never bothered with more complete JavaDocs. Whatever Sun documents is what we try to do. -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Mon Jun 6 12:13:44 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 6 Jun 2005 14:13:44 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: Message-ID: <20050606181245.528C929D56F@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Trent Jarvi > Sent: Monday, June 06, 2005 12:44 PM > To: Jon Nall; Java RXTX discussion > Subject: Re: [Rxtx] Where can I find JavaDoc on the javax.comm API > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > It seems that Sun's javax.comm site does not include JavaDoc'ed API > > and the RxTx site has the API, but no real documentation. Is there > > some site that i'm just missing in my google searches? I'm > looking for > > a copy of the javax.comm API which is documented. > > > > Thanks, > > nall. > > Sun's version is with their binary downloads. RXTX tries to > match that so I never bothered with more complete JavaDocs. > Whatever Sun documents is what we try to do. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Try http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht ml -Ack From gadelavega at yahoo.com.ar Mon Jun 6 12:58:09 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Mon, 6 Jun 2005 15:58:09 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606181245.528C929D56F@mail.electronpusher.org> Message-ID: <20050606185809.57069.qmail@web14603.mail.yahoo.com> --- "David S. Acker" escribi?: > > -----Original Message----- > > From: rxtx-bounces at mail.electronpusher.org > > [mailto:rxtx-bounces at mail.electronpusher.org] On > Behalf Of Trent Jarvi > > Sent: Monday, June 06, 2005 12:44 PM > > To: Jon Nall; Java RXTX discussion > > Subject: Re: [Rxtx] Where can I find JavaDoc on > the javax.comm API > > > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > > > It seems that Sun's javax.comm site does not > include JavaDoc'ed API > > > and the RxTx site has the API, but no real > documentation. Is there > > > some site that i'm just missing in my google > searches? I'm > > looking for > > > a copy of the javax.comm API which is > documented. > > > > > > Thanks, > > > nall. > > > > Sun's version is with their binary downloads. > RXTX tries to > > match that so I never bothered with more complete > JavaDocs. > > Whatever Sun documents is what we try to do. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > Try > http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > ml > -Ack > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > I'm prety sure it was there... but not anymore. Gonzalo A. de la Vega, BI ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From taj at www.linux.org.uk Mon Jun 6 18:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 01:09:14 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606185809.57069.qmail@web14603.mail.yahoo.com> References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: >> http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > > I'm prety sure it was there... but not anymore. > It is there. Maybe the URL got mangled. Try this http://tinyurl.com/8dfp7 It just redirects you to: http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.html -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 7 05:46:39 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Jun 2005 07:46:39 -0400 Subject: [Rxtx] rxtx under fedora - odd procedures Message-ID: Hi All, I was able to get RXTX communications to work under Fedora, but only after I added myself to the UUCP and LOCK groups, logged out and then logged back in. Both groups appear to be needed in order to access the serial ports. Also the group alter did not take until after I logged out and logged back in. My theory is that you need permission to write to the var/spool directory under fedora and that this is the only way to do it. Logging out and logging back in just seems like an odd thing to do. I suppose some users may have to restart X. Ouch! Is this true? The alter_group command indicates that you need to be an su to alter the group database. Does this mean that my serial port users need a database su able person to use serial port applications under RXTX? If so, what is the procedure to make a transparent install work using Java web start? Should I be prompting users for the su password? Should I be telling users to exit from X and log out? Is this the way other serial communications programs work? Thanks! - Doug From sean_montgomery at baseview.com Tue Jun 7 08:14:51 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 7 Jun 2005 10:14:51 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: >>> http://java.sun.com/products/javacomm/javadocs/javax/comm/package- >>> summary.ht >>> > > >> >> I'm prety sure it was there... but not anymore. >> >> > > It is there. Maybe the URL got mangled. Try this > > http://tinyurl.com/8dfp7 > > It just redirects you to: > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > summary.html > Maybe the issue here is that the info is available without frames from that URL, but when you try to access it with frames (from the link on that page) it doesn't work - it takes you to: http://java.sun.com/products/javacomm/javadocs/index.html Which doesn't have anything useful on it. From gadelavega at yahoo.com.ar Tue Jun 7 08:22:50 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:22:50 -0300 (ART) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: Message-ID: <20050607142251.92850.qmail@web14626.mail.yahoo.com> --- "Dr. Douglas Lyon" escribi?: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the > group > alter did not take until after I logged out and > logged back in. > > My theory is that you need permission to write to > the var/spool > directory under fedora and that this is the only way > to do it. > > Logging out and logging back in just seems like an > odd thing to > do. I suppose some users may have to restart X. > Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port > applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log > out? > Is this the way other serial communications programs > work? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Actually, you need the lock group to acces /var/lock directory, and uucp to acces /dev/ttyS*. You (as root) shuold add all users you will allow to use the serial ports to group uucp and all the ones you'll allow to lock the ports to lock group (rxtx needs both). This is not only for rxtx, but for any use of the serial ports. Next time they login they'll be able to work, so if they are in they'll have to log out first. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From gadelavega at yahoo.com.ar Tue Jun 7 08:23:56 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:23:56 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> Message-ID: <20050607142356.93815.qmail@web14624.mail.yahoo.com> --- Sean Montgomery escribi?: > > On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: > > >>> > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > >>> summary.ht > >>> > > > > > >> > >> I'm prety sure it was there... but not anymore. > >> > >> > > > > It is there. Maybe the URL got mangled. Try this > > > > http://tinyurl.com/8dfp7 > > > > It just redirects you to: > > > > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > > summary.html > > > > Maybe the issue here is that the info is available > without frames > from that URL, but when you try to access it with > frames (from the > link on that page) it doesn't work - it takes you > to: > > http://java.sun.com/products/javacomm/javadocs/index.html > > Which doesn't have anything useful on it. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > That's right, my bad. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From jon.nall at gmail.com Tue Jun 7 08:33:40 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 09:33:40 -0500 Subject: [Rxtx] performance expectations Message-ID: Hi all. I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC microcontroller. The protocol I'm using (which I didn't create) looks like this for the section of code I'm concerned with: PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data PIC -> PC: 0x01 // ACK 0xNN // First 8 bits of data 0xMM // Second 8 bits of data I issue ~2000 of these Read commands. The PIC itself has an input fifo which can store 18 bytes, so I can have 18 read commands in flight at a given time. The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k 8N1. I am measuring the time it takes to perform these 2000 commands at around 30 seconds, which is much longer than I anticipated. With the link fully utilized, I expected: Time per byte transmitted: 115200 / 8 = 14400 bytes/second = ~70 uS/byte Time per response transmitted: ~70 uS/byte * 3 bytes/response = ~210 uS/response Time for 2000 responses to be transmitted: ~210 uS/response * 2000 responses = ~420ms I'm a bit new to this, so I may have made some bad asumptions, but I would have expected a time of a couple of seconds to perform the 2000 reads, not 30+ seconds. I'm obviously missing something here. Can someone help me understand what's going on? Thanks, nall. From taj at www.linux.org.uk Tue Jun 7 09:17:48 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:17:48 +0100 (BST) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the group > alter did not take until after I logged out and logged back in. > > My theory is that you need permission to write to the var/spool > directory under fedora and that this is the only way to do it. > > Logging out and logging back in just seems like an odd thing to > do. I suppose some users may have to restart X. Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log out? > Is this the way other serial communications programs work? > RIght now, rxtx requires you do one of two things. 1) Use lock files (recommended). This requires intervention by the root users to allow users to create lock files and open the ports as you note. 2) configure rxtx with --disable-lockfiles. In this case you need only worry about the permissions on /dev/ttyS* I'm not sure what the default on Fedora is with respect to permisions. This is not very attractive. There is a better way it could be done on Fedora. Fedora comes with lockdev library. I've been considering this for some time. We could use that for the locking and do away with many of the problems. The problem is embeded devices running Linux do not come with liblockdev. But for your use, I would consider adding a new option for locking serial devices using liblockdev. lockdev-devel has a man page with further information. SYNOPSIS #include pid_t dev_testlock( const char * devname); pid_t dev_lock( const char * devname); pid_t dev_relock( const char * devname, pid_t pid); pid_t dev_unlock( const char * devname, pid_t pid); cc [ flag ... ] file ... -llockdev [ library ] This would probably need to be a configure time option to prevent problems on embeded Linux devices but could otherwise be the default on Linux. I could toss a quick patch together if this is confusing. It is actually easier than what rxtx does now. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 09:27:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:27:11 +0100 (BST) Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > Hi all. > I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC > microcontroller. The protocol I'm using (which I didn't create) looks like this > for the section of code I'm concerned with: > > PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data > PIC -> PC: 0x01 // ACK > 0xNN // First 8 bits of data > 0xMM // Second 8 bits of data > > I issue ~2000 of these Read commands. The PIC itself has an input fifo which > can store 18 bytes, so I can have 18 read commands in flight at a given time. > The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k > 8N1. > > I am measuring the time it takes to perform these 2000 commands at around 30 > seconds, which is much longer than I anticipated. With the link fully utilized, > I expected: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte > > Time per response transmitted: > ~70 uS/byte * 3 bytes/response = ~210 uS/response > > Time for 2000 responses to be transmitted: > ~210 uS/response * 2000 responses = ~420ms > > I'm a bit new to this, so I may have made some bad asumptions, but I would have > expected a time of a couple of seconds to perform the 2000 reads, not 30+ > seconds. > > I'm obviously missing something here. Can someone help me understand what's > going on? > I've hooked rxtx in loopback with a scope in the past at 9600 baud (baud rate is not important). Using event notification and just writing a byte on event/read the latencey was around 8-12 ms. The JNI is not an efficient way to use native code - especially for bit banging. So if timing is critical you want to move some of the logic into the native code rather than banging over the JNI. 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your performance. C# has advantages here. If you move your logic into the native layer or use gcj (rxtx will work with that too) most of your latency should vanish. You may have to play with some sleeps in eventLoop at that point to get full native efficiency. With gcj all of rxtx becomes 'native code' as java is just treated as a subset of C++. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 09:38:51 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 10:38:51 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: On 6/7/05, Jon Nall wrote: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte of course that should be divided by 10 to account for the start/stop bits, but it barely changes the end results. From carobizar at free.fr Tue Jun 7 10:21:29 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 7 Jun 2005 18:21:29 +0200 Subject: [Rxtx] (no subject) Message-ID: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Hello ! I am a french student and I have to create an application able to read and write on serial and parallel port and to run on Windows and Linux. For the moment my program run on Windows thanks the Java Communication API (version for Microsoft Windows and Solaris/x86). But it doesn't work on Linux. Does a recent version of an installation documentation exist ? I didn't find one on the RXTX site (nothing for the windows installation and the linux installation deals with a "jcl.jar" that I don't know...). So, I have some questions : 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 version or Linux&w32 version ?) What are the differences between them ? Which of them are the most stable ? 2) Where have I to put the .so and .dll files ? 3) What have I to write on the file javax.comm.properties ? 4) Have I to delete the file win32comm.dll included in the Java Comm API ? 5) Have I to keep both comm.jar and RXTXcomm.jar ? Best regards, Caroline. From debief at telemsa.com Tue Jun 7 10:44:56 2005 From: debief at telemsa.com (DEBIEF Eric) Date: Tue, 7 Jun 2005 18:44:56 +0200 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: <200506071844.56656.debief@telemsa.com> Hi, We are "pushing" RxTx /Java here in a half-duplex link. The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC and application handling) about 25?s/byte. The figures are the barely the same on two environments. Environment 1 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Linux 2.6.3, Mdk 10.0. RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : bytes are lost on the wire. I need to investigate this mystery.... Java : 1.4.2-rc1 Blackdown Environment 2 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Windows 2000 Pro RxTx : 2.0.7. Java : 1.4.2_08 SUN I Hope this help, Eric. _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 7 11:05:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:05:45 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, DEBIEF Eric wrote: > Hi, > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. How many write() calls is this? > > Environment 1 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Linux 2.6.3, Mdk 10.0. > RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : > bytes are lost on the wire. I need to investigate this mystery.... > Java : 1.4.2-rc1 Blackdown > > Environment 2 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Windows 2000 Pro > RxTx : 2.0.7. > Java : 1.4.2_08 SUN > In my event/read/write test I found windows was ~20% faster than linux for some reason (strange part is Windows was in VMWare on the same Linux machine). It was about the same rxtx version. There are many problems with rxtx 1.4 with respect to commapi on windows but its code paths are more simple. What some people want from rxtx is perhaps better served by hacking up the very first release as they just want to read and write which is what rxtx was before Sun released commapi. It sounds like perhaps you are pushing out larger writes which will greatly improve results. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 11:16:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:16:49 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118161289.42a5c989cf6a2@imp4-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: On Tue, 7 Jun 2005 carobizar at free.fr wrote: > > Hello ! > > I am a french student and I have to create an application able to read and write > on serial and parallel port and to run on Windows and Linux. > For the moment my program run on Windows thanks the Java Communication API > (version for Microsoft Windows and Solaris/x86). > But it doesn't work on Linux. > > Does a recent version of an installation documentation exist ? > I didn't find one on the RXTX site (nothing for the windows installation and the > linux installation deals with a "jcl.jar" that I don't know...). > > So, I have some questions : > > 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 > version or Linux&w32 version ?) What are the differences between them ? Which > of them are the most stable ? > Use rxtx 2.0 with commapi for sparc solaris from Sun. If you want your current package javax.comm. > 2) Where have I to put the .so and .dll files ? On Linux just use the source, the configure script will do all of that for you. tar -xzvf rxtx-2.0-version mkdir rxtx-2.0-version/build cd rxtx-2.0-version/build ../configure && make install It will do everything for you. With Windows, you need to create the javax.comm.properties and install the DLL on your path. But you can just use Sun's package too. They are intended to be interchangable. > > 3) What have I to write on the file javax.comm.properties ? Driver=gnu.io.RXTXCommDriver More documentation in INSTALL that comes with the source. Sun's documentation should work too. configure does this for you on Linux. > > 4) Have I to delete the file win32comm.dll included in the Java Comm API ? > No > 5) Have I to keep both comm.jar and RXTXcomm.jar ? > Yes. RXTX 2.1 replaces comm.jar but the package is different (gnu.io) to avoid contaminating Sun's namespace. With rxtx 2.0 you need Sun's comm.jar - they work together. > > Best regards, > Caroline. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Tue Jun 7 12:07:34 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 14:07:34 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 Message-ID: <20050607180632.1543A29D5C8@mail.electronpusher.org> Hello, I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our product includes a built in USB to Serial adapter so that when it is connected to your PC over USB, it appears as a serial port. We had problems with Sun's comm library because it did not detect serial ports coming and going properly. I did run into a few issues with RxTx though. I am building under Windows (we support XP and 2000) under cygwin. I used a simple make file for the c code that works under cygwin and ant to build the java stuff. Attached is a diff file. The patches hit the following issues: ParallelImp.c - I am not using config so there is no config.h for me. Also, gcc didn't like a local file (win32termios.h) getting included with <> . RXTXPort.java - You can get an exception during the writeByte, writeArray, nativeDrain, readByte, read, readArray, readTerminatedArray, and nativeAvailable calls. Without this patch the IOLocked count gets stuck incremented. termios.c - If you try to open a port through CreateFile and get ERROR_ACCESS_DENIED it means someone else is using the port. We need to make sure to use serial_close instead of just close. I found that some devices finish their I/O synchronously. The code was treating this as an error. I also added some checking on the ClearError calls. I found a compile error when debugging is turned on (see the usleep change). SerialImp.c - Again, I don't have a config.h and again we must use quotes and not <> to include win32termios.h . I also commented out a report call since it seems to happen constantly on my system. Feel free to use these in any way that you want or just to ignore them. Thanks! -Dave Acker dacker at nomadio.net Software Engineer Nomadio, Inc. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diffs.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/5671d159/diffs.txt From jon.nall at gmail.com Tue Jun 7 12:28:16 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 13:28:16 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, DEBIEF Eric wrote: > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. Hi. This is helpful, thanks. I can think of 2 reasons I'm not collecting the data as fast as I think I should be: 1) the device to PC connection is not at 100% utilization 2) my SerialPortEventListener processing has too much overhead Are there other explanations I might be missing as to why it takes so long to transfer the data? Thanks. nall. From taj at www.linux.org.uk Tue Jun 7 13:21:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:21:46 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > On 6/7/05, DEBIEF Eric wrote: > > We are "pushing" RxTx /Java here in a half-duplex link. > > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > > and application handling) about 25?s/byte. > > The figures are the barely the same on two environments. > > Hi. > This is helpful, thanks. I can think of 2 reasons I'm not collecting > the data as fast as I think I should be: > 1) the device to PC connection is not at 100% utilization > 2) my SerialPortEventListener processing has too much overhead > > Are there other explanations I might be missing as to why it takes so > long to transfer the data? > Polling the port would probably make more sense. You can set the threshold/timeouts to avoid racing and not deal with the event notification. As mentioned earlier I think the event latency is ~10ms. Keep the event listener around, rxtx 2.* does not close well without it. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 13:27:27 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 14:27:27 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, Trent Jarvi wrote: > Polling the port would probably make more sense. You can set the > threshold/timeouts to avoid racing and not deal with the event > notification. As mentioned earlier I think the event latency is ~10ms. Trent, Thanks for the response. Just to make sure I understand what you're talking about, when you say event latency, do you mean the time it takes from when the byte hits the PC's comm port to when rxtx presents it to user code? So if the link is 100% utilized, will my user code see "hiccups" or a steady stream of data? Thanks for helping a serial port newbie. nall. From dacker at nomadio.net Tue Jun 7 13:32:20 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 15:32:20 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <20050607193118.5499329CAA0@mail.electronpusher.org> Some folks asked about the make file and ant steps. I have JAVA_HOME set as follows: $ echo $JAVA_HOME C:\Program Files\Java\jdk1.5.0_01 I have all the code in rxtx/src put into gnu/io . The make file here doesn't have optimizations turned on. We have not tested with it yet. --------------Begin Makefile------------------ CPPFLAGS="-I$(JAVA_HOME)/include" "-I$(JAVA_HOME)/include/win32" SOBJECTS=SerialImp.o fuserImp.o termios.o fixup.o init.o POBJECTS=ParallelImp.o termios.o init.o DLLS=rxtxParallel.dll rxtxSerial.dll all: $(CLASSES) $(DLLS) rxtxSerial.dll: $(SOBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(SOBJECTS) rxtxParallel.dll: $(POBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(POBJECTS) clean: rm -fv $(SOBJECTS) $(POBJECTS) $(DLLS) %.o: %.c gcc -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< %.o: %.cpp g++ -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< --------------End Makefile------------------ Here is the ant target I use to build the rxtx libs. Our build puts the class files in a bin dir. We copy the dlls to a deploy dir and to the build dir. Eclipse seems to like the dlls in the build dir. The deploy dir is used when we build our full package. --------------Begin Ant Section------------------ --------------End Ant Section------------------ > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > David S. Acker > Sent: Tuesday, June 07, 2005 2:08 PM > To: 'Java RXTX discussion' > Subject: [Rxtx] Patches to 2.1-7pre17 > > Hello, > I am using RxTx with the Nomadio Sensor, > http://www.nomadio.net/ . Our product includes a built in > USB to Serial adapter so that when it is connected to your PC > over USB, it appears as a serial port. We had problems with > Sun's comm library because it did not detect serial ports > coming and going properly. > > I did run into a few issues with RxTx though. I am building > under Windows (we support XP and 2000) under cygwin. I used > a simple make file for the c code that works under cygwin and > ant to build the java stuff. Attached is a diff file. The > patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h > for me. Also, gcc didn't like a local file (win32termios.h) > getting included with <> . > > RXTXPort.java - You can get an exception during the > writeByte, writeArray, nativeDrain, readByte, read, > readArray, readTerminatedArray, and nativeAvailable calls. > Without this patch the IOLocked count gets stuck incremented. > > termios.c - If you try to open a port through CreateFile and > get ERROR_ACCESS_DENIED it means someone else is using the > port. We need to make sure to use serial_close instead of > just close. I found that some devices finish their I/O > synchronously. The code was treating this as an error. I > also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we > must use quotes and not <> to include win32termios.h . I > also commented out a report call since it seems to happen > constantly on my system. > > Feel free to use these in any way that you want or just to > ignore them. > Thanks! > > -Dave Acker > dacker at nomadio.net > Software Engineer > Nomadio, Inc. > From taj at www.linux.org.uk Tue Jun 7 13:37:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:37:45 +0100 (BST) Subject: [Rxtx] Re: Stack Smashing Attack In-Reply-To: <200506072012.48860.ferdinand.tatzig@web.de> References: <200506072012.48860.ferdinand.tatzig@web.de> Message-ID: On Tue, 7 Jun 2005, Ferdinand Tatzig wrote: > Dear Trent > > I am using RXTX for serial port communication between a PC and a payment > transaction terminal. > When I run my application under Windows 2000, an i386-Linux or an i386-FreeBSD > it works as I expect it to do. However, when I start it to run on AMD64 > machine with a 64-bit Gentoo Linux, the VM terminates with the following > error: > > Port found: /dev/ttyS0 > java: stack smashing attack in function configure_port() > > I am using a 64-bit Blackdown-1.4.2-01 VM. > > I have searched the internet but have found no information about this error. > > This is the code of the method which initializes the serial port: > > /** > * initializes a serial port for communication with a terminal; only > * accessible within this class > * > * @param communication > * @param serialPortToBeInitialized > * @param tillInterfaceEventListener > */ > private TillInterfaceSerialPort(Communication communication, > String serialPortToBeInitialized, > TillInterfaceEventListener tillInterfaceEventListener) > throws IOException, PortInUseException, > TillInterfaceSerialPortNotFoundException, > TooManyListenersException, UnsupportedCommOperationException { > serialPortName = "not initialized yet"; > CommPortIdentifier portId = null; > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > boolean portFound = false; > String temporarySerialPortName = "not initialized yet"; > > // look for a serial port > while (portList.hasMoreElements() && !portFound) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > temporarySerialPortName = portId.getName(); > if (temporarySerialPortName.equals(serialPortToBeInitialized)) { > System.out.print("Port found: "); > System.out.println(temporarySerialPortName); > serialPortName = temporarySerialPortName; > portFound = true; > } > } > } > if (portFound) { > > // initialize the found port - this command causes the VM to terminate > serialPort = (SerialPort) portId > .open( > TillInterfaceConstants.APPLICATION_NAME, > TillInterfaceConstants > .TIMEOUT_IN_MILLISECONDS_FOR_OPENING_OF_COMMUNICATION_PORT); > > // add an event listener which listens > // on the serial port and notifies the > // serial port object when input bytes > // have been received at the port > serialPort.addEventListener(tillInterfaceEventListener); > serialPort.notifyOnDataAvailable(true); > > // initialize the physical layer > // parameters of the serial port > serialPort.setSerialPortParams(TillInterfaceConstants.BAUD_RATE, > SerialPort.DATABITS_8, SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > // set the inter-character > // timeout (T2) > serialPort > .enableReceiveTimeout(TillInterfaceConstants.INTERCHARACTER_TIMEOUT_IN_MILLISECONDS); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > } else > throw new TillInterfaceSerialPortNotFoundException(); > } > > Any hint to solve this problem would be kindly appreciated. > The only thing that comes to mind here after looking at the offending function is rxtx used to include asm/termios.h but now we moved to termios.h and had glibc fix their headers. The asm/termios.h caused problems as its termios was smaller than the actual termios. This should be fixed in current rxtx versions but you can just glance at SerialImp.c and make sure it does not include asm/termios.h. I've cc'd the rxtx mail list because there was one other mention of stack problems recently. I have used rxtx on opteron systems with success. I have a bug I'm trying hard to reproduce on suse 64 bit (circa linux 2.4.19) systems though. So far I have not been able to reproduce the bug. That said, with gentoo... I like gentoo but I seriously doubt they do any QA with their kernel and Java. I've seen problems before. If you use gentoo and have Java problems, at least stick to Linus (that is an s there) kernels while using Java. I'm not an expert on gentoo but I've seen patches go into experimental kernels that turn out to break java and are reverted before going to Linus just before I see problems with gentoo on this list. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:16:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:16:14 +0100 (BST) Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: On Tue, 7 Jun 2005, David S. Acker wrote: > Hello, > I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our > product includes a built in USB to Serial adapter so that when it is > connected to your PC over USB, it appears as a serial port. We had problems > with Sun's comm library because it did not detect serial ports coming and > going properly. > > I did run into a few issues with RxTx though. I am building under Windows > (we support XP and 2000) under cygwin. I used a simple make file for the c > code that works under cygwin and ant to build the java stuff. Attached is a > diff file. The patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h for me. Also, > gcc didn't like a local file (win32termios.h) getting included with <> . > > RXTXPort.java - You can get an exception during the writeByte, writeArray, > nativeDrain, readByte, read, readArray, readTerminatedArray, and > nativeAvailable calls. Without this patch the IOLocked count gets stuck > incremented. > > termios.c - If you try to open a port through CreateFile and get > ERROR_ACCESS_DENIED it means someone else is using the port. We need to > make sure to use serial_close instead of just close. I found that some > devices finish their I/O synchronously. The code was treating this as an > error. I also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we must use quotes > and not <> to include win32termios.h . I also commented out a report call > since it seems to happen constantly on my system. > > Feel free to use these in any way that you want or just to ignore them. > Thanks! > Hi Dave These patches look great as is. Thanks. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:33:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:33:16 +0100 (BST) Subject: [Rxtx] Patch to IOLocked (fwd) Message-ID: This appears to be another solution to the locking. Chris, the other option just moves the locking into the finally clause which I think would be a little cleaner though I'm posting this patch to so people can comment. -- Trent Jarvi tjarvi at qbang.org ---------- Forwarded message ---------- Date: Wed, 1 Jun 2005 13:01:32 +0100 From: Christopher Dawes To: taj at www.linux.org.uk Subject: Patch to IOLocked Do you want me to check it out of CVS and then submit changes? Christopher -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXPort.java.diff Type: application/octet-stream Size: 6965 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/c442f9fc/RXTXPort.java.obj From Christopher.Dawes at retail-logic.com Wed Jun 8 00:57:24 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 8 Jun 2005 07:57:24 +0100 Subject: [Rxtx] Patch to IOLocked (fwd) [Virus Checked] In-Reply-To: Message-ID: Agreed, much better Java :-) Thanks Christopher ------------------------------------------- Consultant Engineer Retail Logic Limited Fleet GU51 3TZ Tel: +44 (0)1252 644377 Mob: +44 (0)7899 842759 Fax: +44 (0)1252 776708 rxtx-bounces at mail.electronpusher.org wrote on 07/06/2005 21:33:16: > > This appears to be another solution to the locking. Chris, the other > option just moves the locking into the finally clause which I think would > be a little cleaner though I'm posting this patch to so people can > comment. > > -- > Trent Jarvi > tjarvi at qbang.org > > ---------- Forwarded message ---------- > Date: Wed, 1 Jun 2005 13:01:32 +0100 > From: Christopher Dawes > To: taj at www.linux.org.uk > Subject: Patch to IOLocked > > Do you want me to check it out of CVS and then submit changes? > > Christopher[attachment "RXTXPort.java.diff" deleted by Chris > Dawes/Retaillogic/NISABA] _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx From zempftman at gmail.com Wed Jun 8 07:57:25 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 09:57:25 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Maxwell Zempftman Date: May 27, 2005 5:01 PM Subject: Re: [Rxtx] Kaffe & rxtx & armv5b To: rxtx at mail.linuxgrrls.org Here are the results from working this week: The "NullPointerExceptions" are generated by the software when I choose a bad device file. I discovered that this occurs on the i686-RedHat box as well. This exception seems to be generated only by this particular application, and not by the example programs in contrib. So, for example: java MyApp /dev/null <-- generates NullPointerException java MyApp fake <-- generates NullPointerException java MyApp /dev/ttyS0 <-- does not generate NullPointerException Using the program CommCheck (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it appears as though /dev/ttyS0 is the only valid serial device file on the XScale device, so the errors I was getting are not really be bugs. Although /dev/ttyS0 did not generate NullPointerExceptions, I did encounter this error: --start java MyApp /dev/ttyS0 (going mostly from memory, not exact) PortList.hasMoreElements: true Listening on: /dev/ttyS0 Client connected. >From net: echo kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 vmExcept_setJNIFrame Assert: on 'fp != 0' failed. --end I took a look at exception.h, and it seems as though the problematic code does not exist in newer versions of Kaffe (I have been using CVS-2004-11). Next week I will try to use a newer version, although so far everything but CVS-2004-11 has failed. Also, I the device files I need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with something like this? Thanks, Max. > On 5/21/05, Trent Jarvi wrote: > > I'm not sure what is wrong in the first part. It sounds like your > > application may be swallowing an exception while trying to enumerate the > > port or open it. The usual mistake made it not having permissions to > > either open the port or create the lockfile. There should be examples in > > the contrib directory you can try that enumerate and open ports. Maybe > > that will give you some hints. > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > Sun's code limiting you there though you do need to compile and install > > rxtx for the XScale with Sun's Commapi. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > From taj at www.linux.org.uk Wed Jun 8 08:22:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 15:22:44 +0100 (BST) Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > ---------- Forwarded message ---------- > From: Maxwell Zempftman > Date: May 27, 2005 5:01 PM > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > To: rxtx at mail.linuxgrrls.org > > > Here are the results from working this week: > > The "NullPointerExceptions" are generated by the software when I > choose a bad device file. I discovered that this occurs on the > i686-RedHat box as well. This exception seems to be generated only by > this particular application, and not by the example programs in > contrib. So, for example: > > java MyApp /dev/null <-- generates NullPointerException > java MyApp fake <-- generates NullPointerException > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > Using the program CommCheck > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > appears as though /dev/ttyS0 is the only valid serial device file on > the XScale device, so the errors I was getting are not really be bugs. > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > encounter this error: > > --start > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > PortList.hasMoreElements: true > Listening on: /dev/ttyS0 > Client connected. > >From net: echo > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > --end > > I took a look at exception.h, and it seems as though the problematic > code does not exist in newer versions of Kaffe (I have been using > CVS-2004-11). Next week I will try to use a newer version, although so > far everything but CVS-2004-11 has failed. Also, I the device files I > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > something like this? > In RXTXCommDriver, just look for the following code and add /dev/ttyM to the list. Moxa? if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } So: if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyM", // for Moxa ports "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } Linux just has way too many port types to try enumerating them all. There is potential we can add them back in with udev now. > Thanks, > Max. > > > On 5/21/05, Trent Jarvi wrote: > > > I'm not sure what is wrong in the first part. It sounds like your > > > application may be swallowing an exception while trying to enumerate the > > > port or open it. The usual mistake made it not having permissions to > > > either open the port or create the lockfile. There should be examples in > > > the contrib directory you can try that enumerate and open ports. Maybe > > > that will give you some hints. > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > Sun's code limiting you there though you do need to compile and install > > > rxtx for the XScale with Sun's Commapi. > > > > > > -- > > > Trent Jarvi > > > tjarvi at qbang.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Wed Jun 8 12:16:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 08 Jun 2005 13:16:03 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A60B8D.8080500@cs.umn.edu> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> Message-ID: <42A735E3.8040706@atcorp.com> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual serial comport. This isn't so much of a problem, what is, however, is that the comport does not appear to be able to be set to any arbitrary speed, only those from the data_rate enum. I've not found much on using different speeds, has anyone else encountered anything similar? I greatly appreciate any and all comments and suggestions. Thanks in advance, ~ Shawn Lavelle From zempftman at gmail.com Wed Jun 8 12:50:58 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 14:50:58 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: Thanks Trent! That will solve one of the problems. I don't know when my next chance to work on it will be, but I still need to figure out the error I got when I tried opening '/dev/ttyS0' on the Moxa device regarding a failed assertion, seemed to be a Kaffe issue. Thanks for you help, hope to have results soon, Max Englander. On 6/8/05, Trent Jarvi wrote: > On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > > > ---------- Forwarded message ---------- > > From: Maxwell Zempftman > > Date: May 27, 2005 5:01 PM > > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > > To: rxtx at mail.linuxgrrls.org > > > > > > Here are the results from working this week: > > > > The "NullPointerExceptions" are generated by the software when I > > choose a bad device file. I discovered that this occurs on the > > i686-RedHat box as well. This exception seems to be generated only by > > this particular application, and not by the example programs in > > contrib. So, for example: > > > > java MyApp /dev/null <-- generates NullPointerException > > java MyApp fake <-- generates NullPointerException > > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > > > Using the program CommCheck > > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > > appears as though /dev/ttyS0 is the only valid serial device file on > > the XScale device, so the errors I was getting are not really be bugs. > > > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > > encounter this error: > > > > --start > > > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > > > PortList.hasMoreElements: true > > Listening on: /dev/ttyS0 > > Client connected. > > >From net: echo > > > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > > > --end > > > > I took a look at exception.h, and it seems as though the problematic > > code does not exist in newer versions of Kaffe (I have been using > > CVS-2004-11). Next week I will try to use a newer version, although so > > far everything but CVS-2004-11 has failed. Also, I the device files I > > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > > something like this? > > > > > In RXTXCommDriver, just look for the following code and add /dev/ttyM to > the list. Moxa? > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > So: > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyM", // for Moxa ports > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > Linux just has way too many port types to try enumerating them all. There > is potential we can add them back in with udev now. > > > > > Thanks, > > Max. > > > > > On 5/21/05, Trent Jarvi wrote: > > > > I'm not sure what is wrong in the first part. It sounds like your > > > > application may be swallowing an exception while trying to enumerate the > > > > port or open it. The usual mistake made it not having permissions to > > > > either open the port or create the lockfile. There should be examples in > > > > the contrib directory you can try that enumerate and open ports. Maybe > > > > that will give you some hints. > > > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > > Sun's code limiting you there though you do need to compile and install > > > > rxtx for the XScale with Sun's Commapi. > > > > > > > > -- > > > > Trent Jarvi > > > > tjarvi at qbang.org > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- > Trent Jarvi > tjarvi at qbang.org > From taj at www.linux.org.uk Wed Jun 8 12:53:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 19:53:10 +0100 (BST) Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A735E3.8040706@atcorp.com> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: On Wed, 8 Jun 2005, Shawn Lavelle wrote: > Hello, > I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate > with a virtual serial comport. This isn't so much of a problem, what > is, however, is that the comport does not appear to be able to be set to > any arbitrary speed, only those from the data_rate enum. I've not found > much on using different speeds, has anyone else encountered anything > similar? I greatly appreciate any and all comments and suggestions. > This problem is a bit more tricky than it should be. POSIX systems just have a few specified baud rates. Solaris is one of these systems. CommAPI baud rates probably came from someone looking at Solaris. RXTX tries to be POSIX like. W32 is treated as a POSIX like system via a termios.c file in rxtx. Serial ports have baudbase and divisor. So you can set these to come close to the baudrate you want. Some funky equipment like automobile test equipment use baud rates that are not really possible with PC hardware. But if you get as close as possible by changing baud base and divisor, it works. Windows can actually do this for you. I don't know exactly what their code does but if you pass a baudrate to windows, it will guestimate a baudbase and divisor. So you just pass it 10200 baud and it does its job. This is not of very much use the way rxtx does things though. Linux has the standard POSIX like baud rates but if you set the baud rate to B38400, you can set your own baud base and divisor. This is not POSIX that I know of. W32 has more capability than POSIX like systems too. So I did some work to have windows work like Linux via termios.c But the code is not quit right. SerialImp.c and termios.c need some work so all the various buadrates work on Linux and W32. Most other systems will not work beyond what CommAPI already specifies without writting kernel drivers. This is on my todo list but if someone gets to it first, all the better. -- Trent Jarvi tjarvi at qbang.org From carobizar at free.fr Thu Jun 9 06:39:10 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Thu, 9 Jun 2005 14:39:10 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: <1118320750.42a8386e6d3ce@imp5-q.free.fr> Hi ! Thank you for all your advices. I managed to use rxtx on Windows but I have still some difficulties on Linux. I have yet follow your instructions and the configure file has created : - librxtxSerial.so and librxtxParallel.so in the directory /usr/java/j2sdk1.4.2_08/jre/lib/i386 - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the directory /usr/java/j2sdk1.4.2_08/jre/lib - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext But when I run my program, Some exceptions occur : Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver So, 1) What have I forgotten ? 2) Is it possible to make my application run on Linux without the jdk (only the jre) ? Best regards, Caroline. From taj at www.linux.org.uk Thu Jun 9 07:28:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 9 Jun 2005 14:28:05 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118320750.42a8386e6d3ce@imp5-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: On Thu, 9 Jun 2005 carobizar at free.fr wrote: > Hi ! > Thank you for all your advices. > I managed to use rxtx on Windows but I have still some difficulties on Linux. > I have yet follow your instructions and the configure file has created : > - librxtxSerial.so and librxtxParallel.so in the directory > /usr/java/j2sdk1.4.2_08/jre/lib/i386 > - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the > directory /usr/java/j2sdk1.4.2_08/jre/lib > - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext > > But when I run my program, Some exceptions occur : > Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while > loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > com.sun.comm.SolarisDriver > > So, > 1) What have I forgotten ? > The native (.so) libraries are not installed in a directory the JRE is looking for native libraries in. You may look around and see where the .so libraries are in the JRE. I don't know that the jre/lib/i386 directory is specified as a required directory for JREs. I noticed some do not use it. You may try printing the java.libarary.path to see your options. It is also possible to alter the java.library.path. > 2) Is it possible to make my application run on Linux without the jdk (only the > jre) ? Yes. Though installation from source with the JDK is less error prone. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 7 15:03:09 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 07 Jun 2005 16:03:09 -0500 Subject: [Rxtx] Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <42A60B8D.8080500@cs.umn.edu> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual comport. This isn't so much of a problem, what is, however, is that the comport is only ever set to 9600 baud. I've not found this as a documented bug, has anyone else encountered anything similar? I'll try and provide more detail tomorrow, but if anyone has any suggestions or encountered this before, I'd like to hear about it. Thanks in advance, ~ Shawn Lavelle From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Mon Jun 20 01:04:40 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 20 Jun 2005 08:04:40 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: <42B66A88.4060806@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050620/9be208a1/attachment.html From fbalzarro at libero.it Mon Jun 20 02:33:52 2005 From: fbalzarro at libero.it (Fabio Balzarro) Date: Mon, 20 Jun 2005 10:33:52 +0200 Subject: [Rxtx] RXTXPort:close detected bad file descriptor Message-ID: I'm using RXTX libraries on IPAQ 4150 PDA with Windows CE 4.20 and Jeode. When I close a serial port with sp.close() (where sp is a SerialPort) sometimes an error occour 1119256168085: RXTXPort:close detected bad file descriptor What can I do? Thanks Fabio ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From slavelle at atcorp.com Mon Jun 20 08:08:19 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 20 Jun 2005 09:08:19 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: <42B6CDD3.4040409@atcorp.com> It turns out that I did have a driver-not-used issue which has now been resolved and I can use RxTx on it (had to add ttyUSB as a valid port), but only at standard baud rates. Does USB have the same restrictions on port speed as regular RS232? ~ Shawn Trent Jarvi wrote: > Just a note here. > > I have requested a FTDI usb device and they offered to send one for the > purpose of trying to get rxtx working. I have no idea how long that takes > though. > > > On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > > >>I'm afraid we're just using the latest version from the FTDI website. I've >>not yet played with linux properly with this and unfortunately I run gentoo >>and haven't yet successfully compiled in the ftdi driver. I'll let you know >>if I get any success. >> >>Appologies >> >>Christopher >> >>-----Original Message----- >>From: rxtx-bounces at mail.electronpusher.org >>[mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle >>Sent: 15 June 2005 00:00 >>To: Java RXTX discussion >>Subject: Re: [Rxtx] Virtual Com Ports >> >>Hmm, the latter sounds like a lot of work. It does find the virtual comport >>in windows, i must have just missed it earlier (sign of a long day). On the >>linux side, I suspect that something is not correct with the driver >>installation becuase it does not give me a tty for it :( >> >>Christopher, May I ask what driver you are using for your FTDI chip? >>Did you ever encounter problems with not getting a tty assigned for it? >> >> >> Thanks for all your help! >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>They will have to show up as a tty device in Linux. Probably ttyUSB? >>>That will need an entry in RXTXCommDriver.java. If they dont show up >>>as a tty device, rxtx cant treat it like a serial port. It just wont >> >>work. >> >>>With COM3, rxtx will try to open the port and perform a timed out read. >>>Usually if a port is not there, the read blows up or the open blows up. >>>Timing out is fine. COM3 used to share interrupts with COM1. I know >>>you can reassign ports in XP. RXTX scans up through COM255. You may >>>try moving it. >>> >>> >>>The code in question is the following in RXTXCommDriver.java >>> >>> >>> if(osName.equals("Linux")) >>> { >>> String[] Temp = { >>> "ttyS", // linux Serial Ports >>> "ttySA", // for the IPAQs >>> "ttyUSB" // for USB frobs >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>> else if(osName.toLowerCase().indexOf("windows") != -1 ) >>> { >>> String[] Temp = { >>> "COM" // win32 serial ports >>> //"//./COM" // win32 serial ports >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>>If COM3 can be read, it should be found. the ttyUSB should work if >>>thats in the version of RXTXCommDriver.java you have. >>> >>>If this is still a problem, it may be that the driver is erroring on >>>what may be considered normal comm port operations such as setting the >>>speed, timeout, threshold, .. One would have to start looking at each >>>function called in the native open() and read(). >>> >>> >>> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>>seems to find the device using rxtx. Looking at the hardware >>>>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>>>linux. I can't seem to get it to show up as a tty(s#) in linux which >>>>is probably just due to my lack of significant linux knowledge. >>>> >>>> ~ Shawn >>>> >>>>Trent Jarvi wrote: >>>> >>>> >>>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>Has anyone here noticed that virtual comports do not get enumerated >>>>>>via CommPortIdentifier.getPortIdentifiers()?? >>>>>> >>>>>>The device I'm trying to talk to uses an fdti usb to serial >>>>>>convertor with a driver that has it show up as a virtual comport. I >>>>>>can enter this port manually and it will be usable but I cannot get >>>>>>it show up automatically (as in the simple serial demo). Any thoughts >> >>on this? >> >>>>> >>>>>Hi Shawn, >>>>> >>>>>What OS is this and what is the name of the virtual port you are >>>>>trying to open? I suspect the name just needs to be added to >> >>RXTXCommDriver.java. >> >>>>_______________________________________________ >>>>Rxtx mailing list >>>>Rxtx at mail.electronpusher.org >>>>http://www.electronpusher.org/mailman/listinfo/rxtx >>>> >>> >>> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From lyon at docjava.com Mon Jun 20 15:06:08 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 20 Jun 2005 17:06:08 -0400 Subject: [Rxtx] testing Message-ID: Hi All, I am testing my new multi-platform Java Webstart RXTX application (Trent: I could not have done it without you!). So far, I think it will work under Linux (x86), Windows XP, Windows 2000 and MacOS X. The application is available as a Java webstart application at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Edit:Preferences: SerialPort Setup... should bring up a dialog box that enables dialing via the modem. Generally, it does not find internal modems (except on the mac). Why, I don't know. Thanks in advance for trying this new app. All feedback on it is welcome. - Doug Lyon From jasmine at electronpusher.org Tue Jun 21 04:15:53 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Tue, 21 Jun 2005 11:15:53 +0100 Subject: [Rxtx] testing In-Reply-To: References: Message-ID: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > Hi All, > I am testing my new multi-platform Java Webstart RXTX application > (Trent: I could not have done it without you!). > > So far, I think it will work under Linux (x86), Windows XP, > Windows 2000 and MacOS X. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. -J. From taj at www.linux.org.uk Tue Jun 21 05:50:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 12:50:23 +0100 (BST) Subject: [Rxtx] testing In-Reply-To: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> References: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> Message-ID: On Tue, 21 Jun 2005, Jasmine Strong wrote: > > On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > > > Hi All, > > I am testing my new multi-platform Java Webstart RXTX application > > (Trent: I could not have done it without you!). > > > > So far, I think it will work under Linux (x86), Windows XP, > > Windows 2000 and MacOS X. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > on my Mac. > passing -source 1.3 -target 1.3 to javac will compile classes without this problem. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 10:19:25 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 11:19:25 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. Sincerely, Jeremyah Payne From ricardo.trindade at emation.pt Tue Jun 21 13:25:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 20:25:00 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B8698C.2060509@emation.pt> Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > From taj at www.linux.org.uk Tue Jun 21 13:39:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:39:43 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <42B8698C.2060509@emation.pt> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> <42B8698C.2060509@emation.pt> Message-ID: It looks like he has an rs422 device/converter. This is not the problematic 'trying to do protocol X with a serial port' situation unless I'm missing something. I'll follow up with the other email I started. On Tue, 21 Jun 2005, Ricardo Trindade wrote: > Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. > > Payne, Jeremyah L (N-CIM) wrote: > > >Good morning, my name is Jeremyah and I am working on a java project to > >interface with some devices. In short, I have a laptop with a PCMIA > >converter that does RS422 running windows 2000. I also will be > >installing some PCI cards into some Linux boxes that will have probably > >4-8 RS422 ports on them. After doing some reading in order to talk > >with these items using my existing java code I will need an additional > >driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > >trying to get a map sort of where I need to make changes. As I see it, > >I would need to subclass SerialPort to my RS422 interface. That would > >link with a DLL or SO implementation that talks with the hardware. I > >also need to change the listing of working ports in the lookup section > >for serial. Does this seem like I am on the right track? Appreciate > >the support. > > > > > >Sincerely, > >Jeremyah Payne > >_______________________________________________ > >Rxtx mailing list > >Rxtx at mail.electronpusher.org > >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 21 13:40:25 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:40:25 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: On Tue, 21 Jun 2005, Payne, Jeremyah L (N-CIM) wrote: > Good morning, my name is Jeremyah and I am working on a java project to > interface with some devices. In short, I have a laptop with a PCMIA > converter that does RS422 running windows 2000. I also will be > installing some PCI cards into some Linux boxes that will have probably > 4-8 RS422 ports on them. After doing some reading in order to talk with > these items using my existing java code I will need an additional > driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > trying to get a map sort of where I need to make changes. As I see it, I > would need to subclass SerialPort to my RS422 interface. That would link > with a DLL or SO implementation that talks with the hardware. I also > need to change the listing of working ports in the lookup section for > serial. Does this seem like I am on the right track? Appreciate the > support. > Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 13:40:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 14:40:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618954@emss02m08.us.lmco.com> I'd like to except I am dealing with NASA. I am basically building a system to monitor 100+ Units that communicate over RS422. They have some converters in place but want to get rid of them. I'll check through the archives. I had started looking yesterday as was leaving work. -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Ricardo Trindade Sent: Tuesday, June 21, 2005 2:25 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From slavelle at atcorp.com Tue Jun 21 14:58:06 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 21 Jun 2005 15:58:06 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: <42B87F5E.4000403@atcorp.com> > Linux has the standard POSIX like baud rates but if you set the baud rate > to B38400, you can set your own baud base and divisor. This is not POSIX > that I know of. W32 has more capability than POSIX like systems too. So > I did some work to have windows work like Linux via termios.c > > But the code is not quit right. SerialImp.c and termios.c need some > work so all the various buadrates work on Linux and W32. Most other > systems will not work beyond what CommAPI already specifies without > writting kernel drivers. > > This is on my todo list but if someone gets to it first, all the better. Hmm, I guess I didn't read this close enough before. Just to be clear, the pieces to setBaudBase and setDivisor are not yet implemented, correct? Thanks, Shawn From sean_montgomery at baseview.com Tue Jun 21 15:14:08 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 21 Jun 2005 17:14:08 -0400 Subject: [Rxtx] OS X installation - file locations Message-ID: <8AB82C7F-0D19-45F9-AE54-A12C59A8495E@baseview.com> Greetings, I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) using the RXTX installation instructions. RXTX worked fine. Basically you've got: - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions - javax.comm.properties in /System/Library/Frameworks/ JavaVM.framework/Home/lib - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ lib/ext My coworker was concerned that the installation required files to be placed in /System/Library... because those directories are "Apple's" and subject to change at Apple's whim, and that it would be safer (less likely to break when a user updates their OS or Java version or what have you) if all the files could be somewhere in /Library... or / Library/Java. My coworker points out that when 3rd party apps like FrontBase and JBoss need to communicate with Java their jars are placed in /Library/Java/Extensions. Granted that RXTX 2.0 is implementing javax.comm and not just a 3rd party extension, might that be the case - that javax.* stuff needs to be in the Java system files? I'm not the Java maven that my coworker is, so I don't know if any of this is gospel or not. Any OS X/Java experts out there willing to comment? We'd like to be able to install RXTX in the safest, most maintenance free way possible, but if there are specific reasons why javax.comm.properties and comm.jar need to be in /System... then so be it. Any information is welcome, Sean From ricardo.trindade at emation.pt Tue Jun 21 15:56:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 22:56:53 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B88D25.7060604@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050621/f6c9f5fe/attachment.html From jeremyah.l.payne at lmco.com Tue Jun 21 15:22:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 16:22:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618955@emss02m08.us.lmco.com> -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Trent Jarvi Sent: Tuesday, June 21, 2005 2:40 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 As of yet we have not decided on the PCI boards to use yet So I am still waiting to se how we will interface to them. But the laptop is ready to use so ill build a test app for that API for now. The overview of class structure is really what I needed. I guess I will use the 2.1 as you suggested. Thanks for the help thus far! BTW, you guys wouldn't happen to keep class diagrams or anything of that nature around would you? If not I will probably end up having to do some anyway for documentation purposes, I could include them. Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From dmarkman at mac.com Tue Jun 21 18:13:28 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 21 Jun 2005 20:13:28 -0400 Subject: [Rxtx] OS X installation - file locations In-Reply-To: References: Message-ID: <044F520C-585C-4B99-82ED-3BA83DB8CE77@mac.com> Apple doesn't recommend to put jars into the /System/Library/Frameworks/JavaVM.framework/Home/lib/ext folder from other hands it's standard java directory to put extentions if you want to support comm api on whole system then I'd recommend to put jars into the /Library/Java/Extensions folder just like you did if you want to support comm api per user put your jars into the ~/ Library/Java/Extensions On Jun 21, 2005, at 5:14 PM, Java RXTX discussion wrote: > Greetings, > > > I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) > using the RXTX installation instructions. RXTX worked fine. > > > Basically you've got: > - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions > - javax.comm.properties in /System/Library/Frameworks/ > JavaVM.framework/Home/lib > - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ > lib/ext > > > My coworker was concerned that the installation required files to be > placed in /System/Library... because those directories are "Apple's" > and subject to change at Apple's whim, and that it would be safer > (less likely to break when a user updates their OS or Java version or > what have you) if all the files could be somewhere in /Library... or / > Library/Java. My coworker points out that when 3rd party apps like > FrontBase and JBoss need to communicate with Java their jars are > placed in /Library/Java/Extensions. Granted that RXTX 2.0 is > implementing javax.comm and not just a 3rd party extension, might > that be the case - that javax.* stuff needs to be in the Java system > files? > > > I'm not the Java maven that my coworker is, so I don't know if any of > this is gospel or not. Any OS X/Java experts out there willing to > comment? We'd like to be able to install RXTX in the safest, most > maintenance free way possible, but if there are specific reasons why > javax.comm.properties and comm.jar need to be in /System... then so > be it. > > > Any information is welcome, > > > Sean > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Dmitry Markman Dmitry Markman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050622/beea65d0/attachment.html From lyon at docjava.com Thu Jun 23 04:39:47 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 23 Jun 2005 06:39:47 -0400 Subject: [Rxtx] web start + RXTX = strange errors? Message-ID: On: Date: Tue, 21 Jun 2005 11:15:53 +0100 From: Jasmine Strong Writes: An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. ----------- I cannot duplicate your error. My version of Java is: java -version java version "1.4.2_05" Is yours the same? Trent: You wrote: passing -source 1.3 -target 1.3 to javac will compile classes without this problem. ----------- OK, I have updated the disto to work with jdk1.3: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Jasmine: Is this working any better? Thanks! - DL From handzisk at tkn.tu-berlin.de Fri Jun 24 02:37:14 2005 From: handzisk at tkn.tu-berlin.de (Vlado Handziski) Date: Fri, 24 Jun 2005 10:37:14 +0200 (CEST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace Message-ID: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Hi all, let me first express my compliments on the great work you have done with the RXTX library. We have been using the library for some time, and we are at a point where we want to make our code public. For legacy reasons, the code that the RXTX library is bundled with, uses the javax.comm namespace. We have been using the ChangePackage script to change the RXTX2.1 package from gnu.io into javax.comm. We need the independent implementation since we want to be able to directly access /dev/ttyUSBx ports in linux and the CommAPI versions are just not as stable. On the download page, there is a comment that this is in violation of sun's license. Can someone shed more light on this. I was not aware that you can protect the names of the java packages. Best regards, Vlado From ricardo.trindade at emation.pt Fri Jun 24 04:01:17 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 11:01:17 +0100 Subject: [Rxtx] parity missed Message-ID: <42BBD9ED.3060004@emation.pt> Hi, I have a "parity missed error". From previous posts I believe this has to do with CMSPAR not being defined. I checked out 2.1 head from CVS. How can I make sure I do a proper build and CMSPAR is defined ? Perhaps it would be good to have a release snapshot that has this, I think the latest snapshot (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. Another question I have, is why must this depend on kernel headers, why can't it be defined in the RXTX source ? thanks Ricardo From jasmine at electronpusher.org Fri Jun 24 04:09:06 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 24 Jun 2005 11:09:06 +0100 Subject: [Rxtx] web start + RXTX = strange errors? In-Reply-To: References: Message-ID: <644aad2bdbba950f0a2fb12d7dcfd8a6@electronpusher.org> On 23 Jun 2005, at 11:39, Dr. Douglas Lyon wrote: > OK, I have updated the disto to work with jdk1.3: > http://show.docjava.com:8086/book/cgij/code/jnlp/ > addbk.JAddressBook.Main.jnlp > > Jasmine: Is this working any better? Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) -J. From taj at www.linux.org.uk Fri Jun 24 10:54:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 17:54:12 +0100 (BST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: On Fri, 24 Jun 2005, Vlado Handziski wrote: > Hi all, > > let me first express my compliments on the great work you have done with > the RXTX library. > > We have been using the library for some time, and we are at a point where > we want to make our code public. For legacy reasons, the code that the > RXTX library is bundled with, uses the javax.comm namespace. We have been > using the ChangePackage script to change the RXTX2.1 package from gnu.io > into javax.comm. We need the independent implementation since we want to > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > versions are just not as stable. > > On the download page, there is a comment that this is in violation of > sun's license. Can someone shed more light on this. I was not aware that > you can protect the names of the java packages. > > Best regards, > Vlado > I can't provide legal advice as I am not a lawyer. (v) may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are contained in the "java", "javax" or "sun" packages or similar as specified by Sun in any class file naming convention; and The license is in the commapi package from Sun. The above is also in all the EULA's you click through to download from Sun if I'm not mistaken. Simply put, the license taints developers that agree to it. For those developers, Sun has control of the javax.comm namespace. It really does not make sense to put rxtx 2.1 in the javax.comm namespace. It will only cause confusion which I think is the point of the clause above. The gnu.io namespace was perhaps a poor choice and just tossed in when reviewing the license to get out of Sun's namespace. There is nothing in the rxtx license limiting your freedom in this fashion though. Many companies are moving to gnu.io and some distribute it with popular applications you would recognize. I'm tempted to ask you not to contaminate rxtx 2.1 with the javax.comm namespace. You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) extensions to existing classes (which I dont think you are using); it is not just javax.comm. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 24 13:24:09 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 20:24:09 +0100 (BST) Subject: [Rxtx] parity missed In-Reply-To: <42BBD9ED.3060004@emation.pt> References: <42BBD9ED.3060004@emation.pt> Message-ID: On Fri, 24 Jun 2005, Ricardo Trindade wrote: > Hi, > > I have a "parity missed error". From previous posts I believe this > has to do with CMSPAR not being defined. > I checked out 2.1 head from CVS. How can I make sure I do a proper > build and CMSPAR is defined ? Perhaps it would be good to have a release > snapshot that has this, I think the latest snapshot > (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. > > Another question I have, is why must this depend on kernel headers, > why can't it be defined in the RXTX source ? > I used to cheat and grab the CMSPAR from the kernel headers because glibc did not have it. Now rxtx uses the glibc headers and we have a patch in glibc I trust that handles this. It would not be right to override glibc and it wasnt right to use the kernel headers (it really did cause problems). You can override glibc for now with the following in the top of SerialImp.c # define CMSPAR 010000000000 You can check if your distro headers have this right bit looking for the above in bits/termios.h. It should look like this: #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif If it is not defined, please file a bug with your distro as rxtx is not the only thing that will be broken on that distro. I was going to release new cvs snapshots last weekend but got tied up. I'll do it this weekend. I also need to get custom baudrate patches into the cvs snapshot. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Fri Jun 24 13:56:50 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 20:56:50 +0100 Subject: [Rxtx] parity missed In-Reply-To: References: <42BBD9ED.3060004@emation.pt> Message-ID: <42BC6582.2070805@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050624/e3b39631/attachment.html From vlado.handziski at gmail.com Sat Jun 25 06:25:52 2005 From: vlado.handziski at gmail.com (Vlado Handziski) Date: Sat, 25 Jun 2005 14:25:52 +0200 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: <697986ec05062505256ebf381f@mail.gmail.com> Thanks for the clarification. Since changing the bundled source is not an option at this moment, we will consider using javax.comm and RXTX2.0. In the next rewrite, we would probably move to gnu.io . Best regards, Vlado Handziski On 6/24/05, Trent Jarvi wrote: > > On Fri, 24 Jun 2005, Vlado Handziski wrote: > > > Hi all, > > > > let me first express my compliments on the great work you have done with > > the RXTX library. > > > > We have been using the library for some time, and we are at a point > where > > we want to make our code public. For legacy reasons, the code that the > > RXTX library is bundled with, uses the javax.comm namespace. We have > been > > using the ChangePackage script to change the RXTX2.1 package from gnu.io > > into javax.comm. We need the independent implementation since we want to > > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > > versions are just not as stable. > > > > On the download page, there is a comment that this is in violation of > > sun's license. Can someone shed more light on this. I was not aware that > > you can protect the names of the java packages. > > > > Best regards, > > Vlado > > > > I can't provide legal advice as I am not a lawyer. > > (v) may not create, or authorize your licensees to create additional > classes, interfaces, or subpackages that are contained in the "java", > "javax" or "sun" packages or similar as specified by Sun in any class file > naming convention; and > > The license is in the commapi package from Sun. The above is also in all > the EULA's you click through to download from Sun if I'm not mistaken. > > Simply put, the license taints developers that agree to it. For those > developers, Sun has control of the javax.comm namespace. > > It really does not make sense to put rxtx 2.1 in the javax.comm namespace. > It will only cause confusion which I think is the point of the clause > above. The gnu.io namespace was perhaps a poor choice and > just tossed in > when reviewing the license to get out of Sun's namespace. > > There is nothing in the rxtx license limiting your freedom in this fashion > though. Many companies are moving to gnu.io and some > distribute it with > popular applications you would recognize. I'm tempted to ask you not > to contaminate rxtx 2.1 with the javax.comm namespace. > > You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm > using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) > extensions to existing classes (which I dont think you are using); it is > not just javax.comm. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050625/1dadc50e/attachment.html From taj at www.linux.org.uk Sun Jun 26 11:34:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 26 Jun 2005 18:34:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. Message-ID: The attached file should fix baud_base and divisor extensions for Linux The patch is against rxtx 2.1 CVS HEAD. To use this patch, you should set the baud rate to 38400. You can then try SerialPort.setBaudBase(int) and SerialPort.setDivisor(int) There are matching int SerialPort.getBaudBase() and int SerialPort.getDivisor(). What baud bases are available depends upon the serial port card and its driver so this is a bit of a blind attempt on my part. I've looked at the w32 API and I dont see anything available yet. The w32 code in RXTX will probably be figuring out the baud rate based on the tried baud base and divisor and just slamming it at the API for now (the API does something with that but I've not found real documentation on what it does). I dont want to try tinkering with the UART directly yet as that would involve poking machine memory directly and could very easily be error prone in bad ways. I don't expect Solaris or any SysV UNIX systems to work at all with this - ever. It is not standard in any way and will throw Exceptions on everything but Linux (w32 will just fail miserably as it is 1/2 implemented). If anyone has looked at custom baud rates before and has some thoughts or just wants to try the attached untested patch, I'd appreciate any feedback. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- ? autom4te.cache ? build ? output cvs server: Diffing . Index: configure =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure,v retrieving revision 1.35.2.59 diff -u -r1.35.2.59 configure --- configure 16 Oct 2004 16:20:34 -0000 1.35.2.59 +++ configure 26 Jun 2005 16:59:28 -0000 @@ -9644,6 +9644,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { #if defined (__GLIBC__) @@ -9782,6 +9784,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { @@ -9825,7 +9829,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -9837,7 +9841,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 26 Jun 2005 16:59:28 -0000 @@ -218,6 +218,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { #if defined (__GLIBC__) @@ -356,6 +358,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { @@ -399,7 +403,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -411,7 +415,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" cvs server: Diffing CNI cvs server: Diffing MACOSX_IDE cvs server: Diffing MACOSX_IDE/CW cvs server: Diffing MACOSX_IDE/ForPackageMaker cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions cvs server: Diffing MACOSX_IDE/ForPackageMaker/Resources cvs server: Diffing MACOSX_IDE/PB cvs server: Diffing WinCE cvs server: Diffing contrib cvs server: Diffing debian cvs server: Diffing src Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 26 Jun 2005 16:59:29 -0000 @@ -2079,15 +2079,17 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int BaudBase The clock frequency divided by 16. Default * BaudBase is 115200. * @return boolean true on success - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:setBaudBase()"); @@ -2097,10 +2099,11 @@ /** * Extension to CommAPI * @return int BaudBase - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getBaudBase() throws UnsupportedCommOperationException + public int getBaudBase() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getBaudBase()"); @@ -2108,13 +2111,14 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, IOException { if ( debug ) z.reportln( "RXTXPort:setDivisor()"); @@ -2124,10 +2128,11 @@ /** * Extension to CommAPI * @returns int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getDivisor() throws UnsupportedCommOperationException + public int getDivisor() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getDivisor()"); Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 26 Jun 2005 16:59:30 -0000 @@ -1877,16 +1877,27 @@ int fd = get_java_var( env, jobj,"fd","I" ); struct serial_struct sstruct; + if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) + { + goto fail; + } + + sstruct.baud_base = (int) BaudBase; + if ( sstruct.baud_base < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetBaudBase", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetBaudBase", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1914,9 +1925,13 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) ( sstruct.baud_base ) ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetBaudBase", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetBaudBase", strerror( errno ) ); @@ -1950,19 +1965,23 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } if ( sstruct.custom_divisor < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetDivisor", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetDivisor", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1971,7 +1990,7 @@ accept: none perform: Find the Divisor used for custom speeds - return: Divisor + return: Divisor negative value on error. exceptions: Unsupported Comm Operation on systems not supporting TIOCGSERIAL comments: @@ -1990,10 +2009,14 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) sstruct.custom_divisor ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetDivisor", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetDivisor", strerror( errno ) ); @@ -2032,7 +2055,7 @@ /* Open and lock the port so nothing else changes the setting */ - if ( LOCK( filename, pid ) ) goto fail;; + if ( LOCK( filename, pid ) ) goto fail; fd = find_preopened_ports( filename ); if( !fd ) Index: src/SerialPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/Attic/SerialPort.java,v retrieving revision 1.3.2.9 diff -u -r1.3.2.9 SerialPort.java --- src/SerialPort.java 12 Oct 2004 08:59:28 -0000 1.3.2.9 +++ src/SerialPort.java 26 Jun 2005 16:59:30 -0000 @@ -103,13 +103,17 @@ public abstract String getUARTType() throws UnsupportedCommOperationException; public abstract boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getBaudBase() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getDivisor() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setLowLatency() throws UnsupportedCommOperationException; public abstract boolean getLowLatency() cvs server: Diffing src/lfd cvs server: Diffing src/psmisc From uwe at kubosch.no Mon Jun 27 14:13:57 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Mon, 27 Jun 2005 22:13:57 +0200 Subject: [Rxtx] RXTX on FC4 Message-ID: <1119903238.2989.27.camel@BPC0276> Hi all! I just got RXTX to work on Fedora Core 4. The standard download did not work. I had to check the code out from CVS and build it, but then it worked flawlessly. Thanks for your good work. Now I wonder if I should contribute the compiled files so that others will have an easier time than me getting RXTX to work on FC4. What do I do? Who do I talk to? donV From taj at www.linux.org.uk Mon Jun 27 14:29:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 27 Jun 2005 21:29:46 +0100 (BST) Subject: [Rxtx] RXTX on FC4 In-Reply-To: <1119903238.2989.27.camel@BPC0276> References: <1119903238.2989.27.camel@BPC0276> Message-ID: On Mon, 27 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I just got RXTX to work on Fedora Core 4. > > The standard download did not work. > > I had to check the code out from CVS and build it, but then it worked > flawlessly. > > Thanks for your good work. > > Now I wonder if I should contribute the compiled files so that others > will have an easier time than me getting RXTX to work on FC4. What do I > do? Who do I talk to? > > The best thing to do with FC is to contibute an extras RPM. Debian does something like this with their .deb packaging. As rxtx is OS neutral, it is almost impossible to have everything on rxtx.org. If you do get a package in Fedora Extras, I can point a link there. The extra's mail list is here: https://www.redhat.com/mailman/listinfo/fedora-extras-list If it would help to have me release a 'stable' .tar.gz of the source for the RPM submittal process I can do that. It would also trigger upgrades in debian which would not be bad. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Mon Jun 27 16:23:20 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 27 Jun 2005 17:23:20 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: Message-ID: <42C07C58.1030608@atcorp.com> Hey Trent, I installed it and now I get IOExceptions instead of the other one. I'm not sure how those changes would have enabled setDivisor and setBaudBase to work though. Is it significant that this is a USB device emulating a serial port? ~ Shawn From taj at www.linux.org.uk Mon Jun 27 18:07:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 01:07:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: <42C07C58.1030608@atcorp.com> References: <42C07C58.1030608@atcorp.com> Message-ID: On Mon, 27 Jun 2005, Shawn Lavelle wrote: > Hey Trent, > I installed it and now I get IOExceptions instead of the other one. > I'm not sure how those changes would have enabled setDivisor and > setBaudBase to work though. Is it significant that this is a USB device > emulating a serial port? > The USB driver probably does not support this. With USB, the ioctl()'s appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through the linux drivers/usb tree and found to ioctl to support this in Linux 2.6.10. RXTX is not doing very much magic, the patch really only gets the serial struct instead of writing a structure with random values for baudbase and handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel level driver issue not a user space library issue. So if you wanted this to work, the usb serial driver would have to handle the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression after looking through the USB tree quickly. I hope that helps. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Jun 27 18:25:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 27 Jun 2005 20:25:22 -0400 Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) Message-ID: Hi All, I wrote: Jasmine: Is this working any better? And Jasmine says: Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) I am using -source 1.3 and -target 1.3 for the compilation, however, we still seem to have this problem, which my machine (for some reason) does not have. Does anyone have any ideas about what might be the problem? Thanks! - DL From taj at www.linux.org.uk Mon Jun 27 19:04:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 02:04:37 +0100 (BST) Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) In-Reply-To: References: Message-ID: On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I wrote: > Jasmine: Is this working any better? > > And Jasmine says: > Nope. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > > I am using -source 1.3 and -target 1.3 > for the compilation, however, we still seem to have this problem, > which my machine (for some reason) does not have. > Does anyone have any ideas about what might be the problem? > This has shown up in the past with jdk 1.5 compiled jars running on jre 1.4 machines. My guess is either jasmine has an old copy of rxtx with the problem on her machine that is being picked up on the classpath or you have not tried this with jre 1.4. The suggested -source/target fix should avoid the problem. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Mon Jun 27 21:23:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 04:23:55 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: On Tue, 28 Jun 2005, Trent Jarvi wrote: > On Mon, 27 Jun 2005, Shawn Lavelle wrote: > > > Hey Trent, > > I installed it and now I get IOExceptions instead of the other one. > > I'm not sure how those changes would have enabled setDivisor and > > setBaudBase to work though. Is it significant that this is a USB device > > emulating a serial port? > > > > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > > RXTX is not doing very much magic, the patch really only gets the serial > struct instead of writing a structure with random values for baudbase and > handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel > level driver issue not a user space library issue. > > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. > > I hope that helps. > > > It may be possible that you can just modify translate_speed and get_java_baudrate in SerialImp.c to have the new high speds you are after. The defines are in /usr/include/termios.h. #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 You can see many of these are not handled. I dont think CommAPI handled more than 57600 or so. int get_java_baudrate( int native_speed ) { switch( native_speed ) { case B0: return 0; case B50: return 50; case B75: return 75; case B110: return 110; case B134: return 134; case B150: return 150; case B200: return 200; case B300: return 300; case B600: return 600; case B1200: return 1200; case B1800: return 1800; case B2400: return 2400; case B4800: return 4800; case B9600: return 9600; case B19200: return 19200; case B38400: return 38400; case B57600: return 57600; default: return -1; } } int translate_speed( JNIEnv *env, jint speed ) { LEAVE( "RXTXPort:translate_speed" ); switch( speed ) { case 0: return B0; case 50: return B50; case 75: return B75; case 110: return B110; case 134: return B134; case 150: return B150; case 200: return B200; case 300: return B300; case 600: return B600; case 1200: return B1200; case 1800: return B1800; case 2400: return B2400; case 4800: return B4800; case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; #ifdef B57600 case 57600: return B57600; #endif /* B57600 */ #ifdef B115200 case 115200: return B115200; #endif /* B115200 */ #ifdef B230400 case 230400: return B230400; #endif /* B230400 */ #ifdef B460800 case 460800: return B460800; #endif /* B460800 */ #ifdef B14400 case 14400: return B14400; #endif /* B14400 */ #ifdef B28800 case 28800: return B28800; #endif /* B28800 */ #ifdef B128000 /* dima */ case 128000: return B128000; #endif /* dima */ #ifdef B256000 /* dima */ case 256000: return B256000; #endif /* dima */ } /* Handle custom speeds */ if( speed >= 0 ) return speed; else { LEAVE( "RXTXPort:translate_speed: Error condition" ); return -1; } } -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 28 05:20:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 28 Jun 2005 07:20:21 -0400 Subject: [Rxtx] cross-compilation using Make for Mac Message-ID: Hi All, Please excuse the long post; Trent said: >" >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. " Here is what I have on the mac version: java -version java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) When I run: http://show.docjava.com:8086/book/cgij/code/jnlp/math.benchmarks.Dhry.jnlp I get: -- listing properties -- jnlpx.heapsize=NULL,NULL jnlpx.splashport=-1 java.runtime.name=Java(TM) 2 Runtime Environment, Stand... java.protocol.handler.pkgs=com.sun.javaws.net.protocol sun.boot.library.path=/System/Library/Frameworks/JavaVM.fra... java.vm.version=1.4.2-38 awt.nativeDoubleBuffering=true gopherProxySet=false http.auth.serializeRequests=true java.vm.vendor="Apple Computer, Inc." java.vendor.url=http://apple.com/ path.separator=: java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io jnlpx.home=/Applications/Utilities/Java/Java Web... user.country=US sun.os.patch.level=unknown java.vm.specification.name=Java Virtual Machine Specification user.dir=/ java.runtime.version=1.4.2_05-141.4 java.awt.graphicsenv=apple.awt.CGraphicsEnvironment java.endorsed.dirs=/System/Library/Frameworks/JavaVM.fra... os.arch=ppc java.io.tmpdir=/tmp line.separator= java.vm.specification.vendor=Sun Microsystems Inc. jnlpx.remove=false os.name=Mac OS X sun.java2d.fontpath= java.library.path=/Applications/Utilities/Java/Java Web... java.specification.name=Java Platform API Specification java.class.version=48.0 jnlpx.deployment.user.home=/Users/lyon/Library/Caches/Java Web S... java.util.prefs.PreferencesFactory=java.util.prefs.MacOSXPreferencesFactory os.version=10.3.9 user.home=/Users/lyon user.timezone=America/New_York java.security.policy=file:/Applications/Utilities/Java/Jav... java.awt.printerjob=apple.awt.CPrinterJob trustProxy=true java.specification.version=1.4 file.encoding=MacRoman jnlpx.deployment.system.home=/Applications/Utilities/Java/J2SE 5.0... user.name=lyon java.class.path=/Applications/Utilities/Java/Java Web... java.vm.specification.version=1.0 sun.arch.data.model=32 java.home=/System/Library/Frameworks/JavaVM.fra... java.specification.vendor=Sun Microsystems Inc. user.language=en awt.toolkit=apple.awt.CToolkit java.vm.info=mixed mode java.version=1.4.2_05 java.ext.dirs=/Users/lyon/Library/Java/Extensions:/... sun.boot.class.path=/System/Library/Frameworks/JavaVM.fra... java.vendor=Apple Computer, Inc. file.separator=/ java.vendor.url.bug=http://developer.apple.com/java/ sun.cpu.endian=big sun.io.unicode.encoding=UnicodeBig mrj.version=141.3 jnlpx.jvm=/System/Library/Frameworks/JavaVM.fra... sun.cpu.isalist= sun.awt.exception.handler=apple.awt.CToolkit$EventQueueExceptio... javawebstart.version=javaws-1.4.2_05 800 mhz g4,878k ds/sec total time: 1184ms Result: 844594 dhrystone/sec. Load average for last 15 minutes:0.62 So, I feel pretty sure that I have tried this with 1.4. As to modifying the RXTX compilation, that I did not do...and I take your point. I have been using the binary distributions as is. Oops. I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Now when I do a make, I get: make gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known libtool: link: warning: undefined symbols not allowed in i386-pc-mingw32 shared libraries rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ln: `SerialImp.o': File exists make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 So, I do a make clean, then a make: .... (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ar cru .libs/librxtxSerial.a /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o ar: /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o: No such file or directory make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 In the i386 directory, there is a symbolic link left from something: ls -al SerialImp.o lrwxrwxrwx 1 lyon lyon 12 Jun 28 07:03 SerialImp.o -> SerialImp.lo However, the SerialImp.lo is not present (which is the cause of the error, I think). On the other hand, the file I am looking for is present in: i686-pc-linux-gnu Possibly the i386 generation is not clean (of course it is also likely that I am just asking dumb questions, being a newbie to the code and all.). Finally, will this make file regenerate the distro for the mac? I found some really old (from year 2001) files in: cvs/MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions Which I could use for the distro...but I would prefer to do a clean, multi-platform build from make. Thanks! - Doug >On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > >> Hi All, >> I wrote: >> Jasmine: Is this working any better? >> >> And Jasmine says: >> Nope. >> >> An error occurred while launching/running the application. >> >> Title: addbk.JAddressBook.Main >> Vendor: DocJava, Inc. >> Category: Unexpected Error >> >> gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) >> >> > > I am using -source 1.3 and -target 1.3 >> for the compilation, however, we still seem to have this problem, >> which my machine (for some reason) does not have. >> Does anyone have any ideas about what might be the problem? >> > >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. > > >The suggested -source/target fix should avoid the problem. > >-- >Trent Jarvi >tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 28 09:43:41 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 28 Jun 2005 10:43:41 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: <42C1702D.1070307@atcorp.com> > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. There is ioctl stuff in the driver for the chip, but i haven't seen the TIOC*SERIAL entries. That might be why it continues to fail. I did get around the problem, though, by hacking the driver and just specifying the baud rate I need. Now everything works well. Thanks for all the assistance you've provided. ~ Shawn M. Lavelle From taj at www.linux.org.uk Tue Jun 28 12:42:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:42:29 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known Add a compiler flag -DWIN32 The code above should not be compiling on w32 as it is #if !defined(WIN32) You can look at the bottom of Makefile.in to see the w32 compile flags. Search for "WIN32 CrossCompiling from here down" If its still not working, I can set you up with the Bob account. Just email me off the list. W32 compiling is a bit complicated. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 28 12:52:50 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:52:50 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Nods. I did change configure but right now it is only in the baudbase/divisor patch I posted. I'm going to add several extension baud rates that can be supported by normal API calls and commit that today as a followup to my comments yesterday on baudrates. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Wed Jun 29 01:52:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 08:52:10 +0100 (BST) Subject: [Rxtx] [PATCH] More baud rate fixes Message-ID: I went through the native baudrate conversion from Java and added several. This patch is against CVS 2.1 head. I think thats it for baud rate fixes unless someone see something. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- A non-text attachment was scrubbed... Name: baud_base_and_divisor_plus_odd_baudrates.diff.gz Type: application/x-gzip Size: 3291 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050629/4c1ef1c2/baud_base_and_divisor_plus_odd_baudrates.diff.gz From lyon at docjava.com Wed Jun 29 10:33:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 29 Jun 2005 12:33:45 -0400 Subject: [Rxtx] java.comm dependencies Message-ID: Hi All, During a build of the rxtx code, I have left the javax.comm out of the system (on purpose). However, I get an error, at run time: CommPortIdentifier:static initialization() apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: javax/comm/CommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver I am thinking that there is something in the gnu.io.CommPortIdentifier that seeks to load the javax.comm.CommDriver. It was my understanding that we could write code without reference to the javax.comm.CommDriver and that we could work in the gnu namespace. Is this true? Thanks! - Doug From taj at www.linux.org.uk Wed Jun 29 11:16:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 18:16:08 +0100 (BST) Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > During a build of the rxtx code, I have left the > javax.comm out of the system (on purpose). > However, I get an error, at run time: > > CommPortIdentifier:static initialization() > apple.awt.EventQueueExceptionHandler Caught Throwable : > java.lang.NoClassDefFoundError: javax/comm/CommDriver > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > that seeks to load the javax.comm.CommDriver. > > It was my understanding that we could write code without reference > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > Is this true? > Yes. People use 2.1 without javax all the time. There should be no reference to javax at all in rxtx 2.1. You may check your code. I just did a grep through 2.1 and there is nothing. You may look at the classes you are using. If you find javax.comm in your code, replace it with gnu.io and that should be all you need to do. -- Trent Jarvi tjarvi at qbang.org From jayant28k at gmail.com Wed Jun 29 21:49:28 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Thu, 30 Jun 2005 09:19:28 +0530 Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: <6a6a02310506292049778c452f@mail.gmail.com> Trent, I think best idea is to have wiki for rxtx code. So as the traffic is increasing with time. "RXTX" seems to be more popular in embbeded system. Sun Microsystems will always apperciate your efforts on parallel and serial ports commincation based application in IT Industry. Thanks for your help on this forum as "ONE MAN ARMY" ;-) Cheers, Jayant On 6/29/05, Trent Jarvi wrote: > On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > > > Hi All, > > During a build of the rxtx code, I have left the > > javax.comm out of the system (on purpose). > > However, I get an error, at run time: > > > > CommPortIdentifier:static initialization() > > apple.awt.EventQueueExceptionHandler Caught Throwable : > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > > that seeks to load the javax.comm.CommDriver. > > > > It was my understanding that we could write code without reference > > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > > > Is this true? > > > > Yes. People use 2.1 without javax all the time. > > There should be no reference to javax at all in rxtx 2.1. You may check > your code. I just did a grep through 2.1 and there is nothing. You may > look at the classes you are using. > > If you find javax.comm in your code, replace it with gnu.io and that > should be all you need to do. > > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From uwe at kubosch.no Sat Jun 25 02:50:24 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Sat, 25 Jun 2005 10:50:24 +0200 Subject: [Rxtx] RXTX in FC3/FC4 Message-ID: <1119689424.12606.14.camel@BPC0276> Hi all! I am trying to get RXTX to work on Fedora Core, version 3 or 4. I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext directory. I have edited the jre/lib/javax.comm.properties according to the docs. I have tried this with both rxtx 2.0 and 2.1. I have tried on two different machines. I have tried with java 1.4.2 and java 1.5.0, both from Sun. I always get a signall 11 from the native libraries when they are loaded. Is this a common problem? Any help is greatly appreciated. Below is the start of the error message. More can be supplied on demand. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x65015A Function=(null)+0x65015A Library=/lib/ld-linux.so.2 NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) - locked <0xed46f628> (a java.util.Vector) - locked <0xed471708> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xed46ebc0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.InitializeDriver(CommPortIdentifier.java:213) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:248) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:351) at com.jpeterson.x10.module.CM11A.allocate(CM11A.java:1160) at net.sourceforge.cruisecontrol.publishers.X10Publisher.send(X10Publisher.java:182) at net.sourceforge.cruisecontrol.publishers.X10Publisher.turnOff(X10Publisher.java:171) at net.sourceforge.cruisecontrol.publishers.X10Publisher.handleBuild(X10Publisher.java:148) at net.sourceforge.cruisecontrol.publishers.X10Publisher.publish(X10Publisher.java:141) at net.sourceforge.cruisecontrol.Project.publish(Project.java:679) at net.sourceforge.cruisecontrol.Project.build(Project.java:227) at net.sourceforge.cruisecontrol.Project.execute(Project.java:153) at net.sourceforge.cruisecontrol.ProjectWrapper.run(ProjectWrapper.java:66) at java.lang.Thread.run(Thread.java:534) From chris_jh at blueyonder.co.uk Tue Jun 28 05:37:10 2005 From: chris_jh at blueyonder.co.uk (Christopher Harris) Date: Tue, 28 Jun 2005 12:37:10 +0100 Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError Message-ID: <42C13666.9030108@blueyonder.co.uk> Hi I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 32bit) The serial ports work fine with no issues, but when i try to use the parallel port i get this message Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:66) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) I am trying to print a line out to port "/dev/lp0" At first i thought it could not find the librxtxParallel.so file, but when i renamed it i got a different saying it could not find the library. I have tried to run as root no difference. It is really weird, i get no compile errors and the serial ports work fine. I changed the LPRPort.java and commented out the Initialize call method. And just get the same error but for the method open. It is as though it can't see the methods, and yet it can see the library. I did have a bit of check of the JNI implementation in rxtx but could not spot anything. Yours Thankfully Christopher Harris From lyon at docjava.com Thu Jun 30 02:28:09 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 04:28:09 -0400 Subject: [Rxtx] tools Message-ID: Hi All, I have been thinking about automatic cross-platform native method development of Java/C programs. It appears that different binary tools are needed to target different platforms. Configuration seems a bit painful. Is there something better available than make? Is ANT any good at this? Has anyone tried: http://jnipp.sourceforge.net/ Thanks! - Doug From lyon at docjava.com Thu Jun 30 04:11:17 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 06:11:17 -0400 Subject: [Rxtx] javax.comm Message-ID: Hi All, When I load my jar files on a linux box, all is well. However, when I load them on a mac, I get: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver The jar files for the mac are different from the jar files for linux, because recompilation of the native code for the mac has not been easy, for me. As a result, the RXTX jars are tending toward specific versions and platforms. Probably, this is not an ideal situation, but, I suspect, it is common. I have an idea that we could create a single JNLP distro site that we can make reference to that would enable a uniform repository of synchronized signed native methods and jars for RXTX. For example, the one-wire Maxim folks have a real-nice approach where their stuff makes reference to another JNLP file that contains all the stuff we need to make RXTX work. Check it out at: http://www.maxim-ic.com/products/ibutton/software/1wire/OneWireViewer.cfm However, even they have problems on an unconfigured machine: Specified adapter name "DS9097U" is not known * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cannot load default adapter. Please check that the adapter is connected and that no other application is using the port. If you have checked the adapter, the default port might not be selected. Either set the value of the TMEX default using the utility provided with the TMEX Runtime, or create a new file in the /lib folder called onewireviewer.properties with two lines, similar to the following: #native win32 drivers adapter.name={DS9097U} adapter.port=COM1 #or javax.comm drivers adapter.name=DS9097U adapter.port=COM1 The full path to this file should be: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/onewireviewer.properties ---- Wow, that is a show stopper! Configuration is something that we really need to think about as an automatic thing, particularly for web start users. You can't ask a person who wants to run an application to figure out how to alter a properties file. If you know you need one, then get permission and make one...automatically. That makes a lot of sense, to me. Basically, we need an installer. At the very least, all the pre-built binaries and jars needed for the RXTX package on several platforms should be available from a single place. One this happens, we can make a JNLP file that is platform specific, but can give us a level of indirection. Is this something that has been done already? Thanks! - Doug From taj at www.linux.org.uk Thu Jun 30 08:10:22 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 15:10:22 +0100 (BST) Subject: [Rxtx] tools In-Reply-To: References: Message-ID: On Thu, 30 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I have been thinking about automatic cross-platform > native method development of Java/C programs. > > It appears that different binary tools are needed to target different > platforms. Configuration seems a bit painful. > > Is there something better available than make? > > Is ANT any good at this? I'm far from an Ant expert but have used it for other projects. The main problem I see with ant is there is no mainstream support for platform neutral neutral library creation as far as I can tell. I think ant is a fine replacement for make but I've not seen a suitable replacement for autoconf. At that point, make is as good as anything. It should be possible to create a ant build.xml that works on say Solaris, Linux, Windows and Mac OS X. The problem is when you are trying to build a library for embeded ARM from Mac OS X. > Has anyone tried: > http://jnipp.sourceforge.net/ -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:22:02 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:22:02 +0100 (BST) Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <1119689424.12606.14.camel@BPC0276> References: <1119689424.12606.14.camel@BPC0276> Message-ID: On Sat, 25 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I am trying to get RXTX to work on Fedora Core, version 3 or 4. > > I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 > directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext > directory. > > I have edited the jre/lib/javax.comm.properties according to the docs. > > I have tried this with both rxtx 2.0 and 2.1. > > I have tried on two different machines. > > I have tried with java 1.4.2 and java 1.5.0, both from Sun. > > I always get a signall 11 from the native libraries when they are > loaded. Is this a common problem? Any help is greatly appreciated. > Below is the start of the error message. More can be supplied on > demand. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x65015A > Function=(null)+0x65015A > Library=/lib/ld-linux.so.2 > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) If you compile rxtx from source, this will probably go away. I'm not sure what the exact cause is but it looks like the binaries are not suitable for FC3/4. The ABI may have changed since those had been compiled. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:26:56 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:26:56 +0100 (BST) Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError In-Reply-To: <42C13666.9030108@blueyonder.co.uk> References: <42C13666.9030108@blueyonder.co.uk> Message-ID: tOn Tue, 28 Jun 2005, Christopher Harris wrote: > Hi > > I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 > 32bit) > > The serial ports work fine with no issues, but when i try to use the > parallel port i get this message > > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:66) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) > > > I am trying to print a line out to port "/dev/lp0" > > At first i thought it could not find the librxtxParallel.so file, but > when i renamed it i got a different saying it could not find the library. > > I have tried to run as root no difference. > > It is really weird, i get no compile errors and the serial ports work fine. > > I changed the LPRPort.java and commented out the Initialize call method. > And just get the same error but for the method open. > > It is as though it can't see the methods, and yet it can see the library. > I did have a bit of check of the JNI implementation in rxtx but could > not spot anything. > > > You can check if the symbols are in the shared library: nm librxtxSerial.so |grep Initialize If the symbols are not there, there was a build error. Watch very close for build errors while compiling from source. I suspect something isnt behaving right. -- Trent Jarvi tjarvi at qbang.org From allen at adbyrne.us Thu Jun 30 06:55:58 2005 From: allen at adbyrne.us (Allen Byrne) Date: Thu, 30 Jun 2005 07:55:58 -0500 Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> References: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> Message-ID: <200506300755.59159.allen@adbyrne.us> On Thursday 30 June 2005 00:31, rxtx-request at mail.electronpusher.org wrote: > >Message: 8 >Date: Sat, 25 Jun 2005 10:50:24 +0200 >From: Uwe Kubosch >Subject: [Rxtx] RXTX in FC3/FC4 >To: rxtx at mail.electronpusher.org >Message-ID: <1119689424.12606.14.camel at BPC0276> >Content-Type: text/plain > >Hi all! > >I am trying to get RXTX to work on Fedora Core, version 3 or 4. > >I have tried this with both rxtx 2.0 and 2.1. > >I have tried on two different machines. > >I have tried with java 1.4.2 and java 1.5.0, both from Sun. > >I always get a signall 11 from the native libraries when they are >loaded. ?Is this a common problem? ?Any help is greatly appreciated. >Below is the start of the error message. ?More can be supplied on >demand. > >An unexpected exception has been detected in native code outside the VM. >Unexpected Signal : 11 occurred at PC=0x65015A >Function=(null)+0x65015A >Library=/lib/ld-linux.so.2 > I had thi same problem on SUSE9.3 and java 1.5.0. After searching through the archives, I found a patch that required adding a sleep(1000) command in two functions of SerialIO.java. This only was for rxtx2.1, I had no trouble with rxtx2.0. Note, also I had to add the "|1.5*" sequence to the configure.in file to get good *.so libs. Again 2.0 was fine. -- Allen Byrne adbyrne at ieee.org http://modelrr.adbyrne.us From taj at www.linux.org.uk Fri Jun 3 01:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 08:57:29 +0100 (BST) Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 3 09:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 16:57:53 +0100 (BST) Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi at qbang.org From jasmine at electronpusher.org Fri Jun 3 10:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 17:12:21 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 11:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:02:09 +0100 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 11:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:05:10 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From jon.nall at gmail.com Mon Jun 6 09:13:58 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 10:13:58 -0500 Subject: [Rxtx] StackOverflowError Message-ID: I have a fairly small application that is communicating to a microcontroller programmer at 115.2k. I have a test where I try and dump the memory of the microcontroller (whose size is 8k and change). Things are going smoothly and the data looks good. Then after reading out ~6.5k of data, I get a StackOverflowError. The stack trace looks like: CommInterface.serialEvent(): 324 // this is my code RXTXPort.sendEvent(): 732 RXTXPort.eventLoop() [Native] MonitorThread.run(): 1531 I am running on windows and using rxtx-2.1-CVS-20050120. When I increased the stack size to 512k, I could read the entire chip without issue. But that doesn't seem like the right thing to do without root causing what's happening. My code doesn't include any recursion and the stack trace looks terribly short, so I'm a bit confused as to why I'm getting a StackOverflowError. CommInterface.serialEvent() does little more than grab the available bytes, enter a synchronized block, stick them in a common data area for the main thread to use and leave the synchronization block. I guess my question is: are there any known issues with the default stack size when using the latest rxtx on windows? thanks, nall. From taj at www.linux.org.uk Mon Jun 6 09:27:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 16:27:34 +0100 (BST) Subject: [Rxtx] StackOverflowError In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > I have a fairly small application that is communicating to a > microcontroller programmer at 115.2k. I have a test where I try and > dump the memory of the microcontroller (whose size is 8k and change). > Things are going smoothly and the data looks good. Then after reading > out ~6.5k of data, I get a StackOverflowError. The stack trace looks > like: > > CommInterface.serialEvent(): 324 // this is my code > RXTXPort.sendEvent(): 732 > RXTXPort.eventLoop() [Native] > MonitorThread.run(): 1531 > > I am running on windows and using rxtx-2.1-CVS-20050120. When I > increased the stack size to 512k, I could read the entire chip without > issue. But that doesn't seem like the right thing to do without root > causing what's happening. My code doesn't include any recursion and > the stack trace looks terribly short, so I'm a bit confused as to why > I'm getting a StackOverflowError. > > CommInterface.serialEvent() does little more than grab the available > bytes, enter a synchronized block, stick them in a common data area > for the main thread to use and leave the synchronization block. > > I guess my question is: are there any known issues with the default > stack size when using the latest rxtx on windows? > This is the first I've heard of the problem. It is strange as you mention lookin at the stack trace. That cant be taking up too much space. If you just toss the data instead of trying to put it in your work area, does it persist? -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Mon Jun 6 10:09:39 2005 From: lengyel at gmail.com (FL) Date: Mon, 6 Jun 2005 12:09:39 -0400 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on which the jdk1.5.0_03 is installed. I found that the INSTALL documentation seems to be in error. It states that javacomm20-x86.tar.Z (the Java Communications API for Solaris/x86) must be used, in fact this choice led to the following test with theBlackBox sample program in the commapi: root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG BlackBox -p /dev/ttyS0 Port /dev/ttyS0 not found! No serial ports found! Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to cause Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to the Eclipse stable build version 3.1M7 to avoid this. However, I found that using the Solaris/Sparc version of commapi worked on my system. I have documented this on: http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050606/b28fb9a7/attachment-0001.html From taj at www.linux.org.uk Mon Jun 6 10:30:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:30:27 +0100 (BST) Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, FL wrote: > I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on > which the jdk1.5.0_03 is installed. I found that the INSTALL documentation > seems to be in error. It states that javacomm20-x86.tar.Z (the Java > Communications API for Solaris/x86) must be used, in fact this choice led to > the following test with theBlackBox sample program in the commapi: > > root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG > BlackBox -p /dev/ttyS0 > Port /dev/ttyS0 not found! > No serial ports found! > > Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to > cause > Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to > the Eclipse stable build version 3.1M7 to avoid this. > > However, I found that using the Solaris/Sparc version of commapi > worked on my system. > > I have documented this on: > > http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 > Thanks FL. I'll change the documentation to point to the SPARC comm.jar. In the past, any Solaris was good enough, we tried to avoid the w32 comm.jar because it made native calls rxtx would never implement on any OS as they are not platform neutral. I'll withold comments about Sun's comm.jar being different on various CPUs within even the same OS. RXTX 2.1 does not need to do that even acrossed OSs for instance. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 6 10:35:43 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 11:35:43 -0500 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API Message-ID: It seems that Sun's javax.comm site does not include JavaDoc'ed API and the RxTx site has the API, but no real documentation. Is there some site that i'm just missing in my google searches? I'm looking for a copy of the javax.comm API which is documented. Thanks, nall. From taj at www.linux.org.uk Mon Jun 6 10:44:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:44:03 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > It seems that Sun's javax.comm site does not include JavaDoc'ed API > and the RxTx site has the API, but no real documentation. Is there > some site that i'm just missing in my google searches? I'm looking for > a copy of the javax.comm API which is documented. > > Thanks, > nall. Sun's version is with their binary downloads. RXTX tries to match that so I never bothered with more complete JavaDocs. Whatever Sun documents is what we try to do. -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Mon Jun 6 12:13:44 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 6 Jun 2005 14:13:44 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: Message-ID: <20050606181245.528C929D56F@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Trent Jarvi > Sent: Monday, June 06, 2005 12:44 PM > To: Jon Nall; Java RXTX discussion > Subject: Re: [Rxtx] Where can I find JavaDoc on the javax.comm API > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > It seems that Sun's javax.comm site does not include JavaDoc'ed API > > and the RxTx site has the API, but no real documentation. Is there > > some site that i'm just missing in my google searches? I'm > looking for > > a copy of the javax.comm API which is documented. > > > > Thanks, > > nall. > > Sun's version is with their binary downloads. RXTX tries to > match that so I never bothered with more complete JavaDocs. > Whatever Sun documents is what we try to do. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Try http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht ml -Ack From gadelavega at yahoo.com.ar Mon Jun 6 12:58:09 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Mon, 6 Jun 2005 15:58:09 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606181245.528C929D56F@mail.electronpusher.org> Message-ID: <20050606185809.57069.qmail@web14603.mail.yahoo.com> --- "David S. Acker" escribi?: > > -----Original Message----- > > From: rxtx-bounces at mail.electronpusher.org > > [mailto:rxtx-bounces at mail.electronpusher.org] On > Behalf Of Trent Jarvi > > Sent: Monday, June 06, 2005 12:44 PM > > To: Jon Nall; Java RXTX discussion > > Subject: Re: [Rxtx] Where can I find JavaDoc on > the javax.comm API > > > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > > > It seems that Sun's javax.comm site does not > include JavaDoc'ed API > > > and the RxTx site has the API, but no real > documentation. Is there > > > some site that i'm just missing in my google > searches? I'm > > looking for > > > a copy of the javax.comm API which is > documented. > > > > > > Thanks, > > > nall. > > > > Sun's version is with their binary downloads. > RXTX tries to > > match that so I never bothered with more complete > JavaDocs. > > Whatever Sun documents is what we try to do. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > Try > http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > ml > -Ack > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > I'm prety sure it was there... but not anymore. Gonzalo A. de la Vega, BI ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From taj at www.linux.org.uk Mon Jun 6 18:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 01:09:14 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606185809.57069.qmail@web14603.mail.yahoo.com> References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: >> http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > > I'm prety sure it was there... but not anymore. > It is there. Maybe the URL got mangled. Try this http://tinyurl.com/8dfp7 It just redirects you to: http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.html -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 7 05:46:39 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Jun 2005 07:46:39 -0400 Subject: [Rxtx] rxtx under fedora - odd procedures Message-ID: Hi All, I was able to get RXTX communications to work under Fedora, but only after I added myself to the UUCP and LOCK groups, logged out and then logged back in. Both groups appear to be needed in order to access the serial ports. Also the group alter did not take until after I logged out and logged back in. My theory is that you need permission to write to the var/spool directory under fedora and that this is the only way to do it. Logging out and logging back in just seems like an odd thing to do. I suppose some users may have to restart X. Ouch! Is this true? The alter_group command indicates that you need to be an su to alter the group database. Does this mean that my serial port users need a database su able person to use serial port applications under RXTX? If so, what is the procedure to make a transparent install work using Java web start? Should I be prompting users for the su password? Should I be telling users to exit from X and log out? Is this the way other serial communications programs work? Thanks! - Doug From sean_montgomery at baseview.com Tue Jun 7 08:14:51 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 7 Jun 2005 10:14:51 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: >>> http://java.sun.com/products/javacomm/javadocs/javax/comm/package- >>> summary.ht >>> > > >> >> I'm prety sure it was there... but not anymore. >> >> > > It is there. Maybe the URL got mangled. Try this > > http://tinyurl.com/8dfp7 > > It just redirects you to: > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > summary.html > Maybe the issue here is that the info is available without frames from that URL, but when you try to access it with frames (from the link on that page) it doesn't work - it takes you to: http://java.sun.com/products/javacomm/javadocs/index.html Which doesn't have anything useful on it. From gadelavega at yahoo.com.ar Tue Jun 7 08:22:50 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:22:50 -0300 (ART) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: Message-ID: <20050607142251.92850.qmail@web14626.mail.yahoo.com> --- "Dr. Douglas Lyon" escribi?: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the > group > alter did not take until after I logged out and > logged back in. > > My theory is that you need permission to write to > the var/spool > directory under fedora and that this is the only way > to do it. > > Logging out and logging back in just seems like an > odd thing to > do. I suppose some users may have to restart X. > Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port > applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log > out? > Is this the way other serial communications programs > work? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Actually, you need the lock group to acces /var/lock directory, and uucp to acces /dev/ttyS*. You (as root) shuold add all users you will allow to use the serial ports to group uucp and all the ones you'll allow to lock the ports to lock group (rxtx needs both). This is not only for rxtx, but for any use of the serial ports. Next time they login they'll be able to work, so if they are in they'll have to log out first. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From gadelavega at yahoo.com.ar Tue Jun 7 08:23:56 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:23:56 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> Message-ID: <20050607142356.93815.qmail@web14624.mail.yahoo.com> --- Sean Montgomery escribi?: > > On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: > > >>> > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > >>> summary.ht > >>> > > > > > >> > >> I'm prety sure it was there... but not anymore. > >> > >> > > > > It is there. Maybe the URL got mangled. Try this > > > > http://tinyurl.com/8dfp7 > > > > It just redirects you to: > > > > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > > summary.html > > > > Maybe the issue here is that the info is available > without frames > from that URL, but when you try to access it with > frames (from the > link on that page) it doesn't work - it takes you > to: > > http://java.sun.com/products/javacomm/javadocs/index.html > > Which doesn't have anything useful on it. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > That's right, my bad. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From jon.nall at gmail.com Tue Jun 7 08:33:40 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 09:33:40 -0500 Subject: [Rxtx] performance expectations Message-ID: Hi all. I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC microcontroller. The protocol I'm using (which I didn't create) looks like this for the section of code I'm concerned with: PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data PIC -> PC: 0x01 // ACK 0xNN // First 8 bits of data 0xMM // Second 8 bits of data I issue ~2000 of these Read commands. The PIC itself has an input fifo which can store 18 bytes, so I can have 18 read commands in flight at a given time. The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k 8N1. I am measuring the time it takes to perform these 2000 commands at around 30 seconds, which is much longer than I anticipated. With the link fully utilized, I expected: Time per byte transmitted: 115200 / 8 = 14400 bytes/second = ~70 uS/byte Time per response transmitted: ~70 uS/byte * 3 bytes/response = ~210 uS/response Time for 2000 responses to be transmitted: ~210 uS/response * 2000 responses = ~420ms I'm a bit new to this, so I may have made some bad asumptions, but I would have expected a time of a couple of seconds to perform the 2000 reads, not 30+ seconds. I'm obviously missing something here. Can someone help me understand what's going on? Thanks, nall. From taj at www.linux.org.uk Tue Jun 7 09:17:48 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:17:48 +0100 (BST) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the group > alter did not take until after I logged out and logged back in. > > My theory is that you need permission to write to the var/spool > directory under fedora and that this is the only way to do it. > > Logging out and logging back in just seems like an odd thing to > do. I suppose some users may have to restart X. Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log out? > Is this the way other serial communications programs work? > RIght now, rxtx requires you do one of two things. 1) Use lock files (recommended). This requires intervention by the root users to allow users to create lock files and open the ports as you note. 2) configure rxtx with --disable-lockfiles. In this case you need only worry about the permissions on /dev/ttyS* I'm not sure what the default on Fedora is with respect to permisions. This is not very attractive. There is a better way it could be done on Fedora. Fedora comes with lockdev library. I've been considering this for some time. We could use that for the locking and do away with many of the problems. The problem is embeded devices running Linux do not come with liblockdev. But for your use, I would consider adding a new option for locking serial devices using liblockdev. lockdev-devel has a man page with further information. SYNOPSIS #include pid_t dev_testlock( const char * devname); pid_t dev_lock( const char * devname); pid_t dev_relock( const char * devname, pid_t pid); pid_t dev_unlock( const char * devname, pid_t pid); cc [ flag ... ] file ... -llockdev [ library ] This would probably need to be a configure time option to prevent problems on embeded Linux devices but could otherwise be the default on Linux. I could toss a quick patch together if this is confusing. It is actually easier than what rxtx does now. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 09:27:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:27:11 +0100 (BST) Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > Hi all. > I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC > microcontroller. The protocol I'm using (which I didn't create) looks like this > for the section of code I'm concerned with: > > PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data > PIC -> PC: 0x01 // ACK > 0xNN // First 8 bits of data > 0xMM // Second 8 bits of data > > I issue ~2000 of these Read commands. The PIC itself has an input fifo which > can store 18 bytes, so I can have 18 read commands in flight at a given time. > The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k > 8N1. > > I am measuring the time it takes to perform these 2000 commands at around 30 > seconds, which is much longer than I anticipated. With the link fully utilized, > I expected: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte > > Time per response transmitted: > ~70 uS/byte * 3 bytes/response = ~210 uS/response > > Time for 2000 responses to be transmitted: > ~210 uS/response * 2000 responses = ~420ms > > I'm a bit new to this, so I may have made some bad asumptions, but I would have > expected a time of a couple of seconds to perform the 2000 reads, not 30+ > seconds. > > I'm obviously missing something here. Can someone help me understand what's > going on? > I've hooked rxtx in loopback with a scope in the past at 9600 baud (baud rate is not important). Using event notification and just writing a byte on event/read the latencey was around 8-12 ms. The JNI is not an efficient way to use native code - especially for bit banging. So if timing is critical you want to move some of the logic into the native code rather than banging over the JNI. 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your performance. C# has advantages here. If you move your logic into the native layer or use gcj (rxtx will work with that too) most of your latency should vanish. You may have to play with some sleeps in eventLoop at that point to get full native efficiency. With gcj all of rxtx becomes 'native code' as java is just treated as a subset of C++. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 09:38:51 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 10:38:51 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: On 6/7/05, Jon Nall wrote: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte of course that should be divided by 10 to account for the start/stop bits, but it barely changes the end results. From carobizar at free.fr Tue Jun 7 10:21:29 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 7 Jun 2005 18:21:29 +0200 Subject: [Rxtx] (no subject) Message-ID: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Hello ! I am a french student and I have to create an application able to read and write on serial and parallel port and to run on Windows and Linux. For the moment my program run on Windows thanks the Java Communication API (version for Microsoft Windows and Solaris/x86). But it doesn't work on Linux. Does a recent version of an installation documentation exist ? I didn't find one on the RXTX site (nothing for the windows installation and the linux installation deals with a "jcl.jar" that I don't know...). So, I have some questions : 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 version or Linux&w32 version ?) What are the differences between them ? Which of them are the most stable ? 2) Where have I to put the .so and .dll files ? 3) What have I to write on the file javax.comm.properties ? 4) Have I to delete the file win32comm.dll included in the Java Comm API ? 5) Have I to keep both comm.jar and RXTXcomm.jar ? Best regards, Caroline. From debief at telemsa.com Tue Jun 7 10:44:56 2005 From: debief at telemsa.com (DEBIEF Eric) Date: Tue, 7 Jun 2005 18:44:56 +0200 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: <200506071844.56656.debief@telemsa.com> Hi, We are "pushing" RxTx /Java here in a half-duplex link. The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC and application handling) about 25?s/byte. The figures are the barely the same on two environments. Environment 1 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Linux 2.6.3, Mdk 10.0. RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : bytes are lost on the wire. I need to investigate this mystery.... Java : 1.4.2-rc1 Blackdown Environment 2 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Windows 2000 Pro RxTx : 2.0.7. Java : 1.4.2_08 SUN I Hope this help, Eric. _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 7 11:05:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:05:45 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, DEBIEF Eric wrote: > Hi, > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. How many write() calls is this? > > Environment 1 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Linux 2.6.3, Mdk 10.0. > RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : > bytes are lost on the wire. I need to investigate this mystery.... > Java : 1.4.2-rc1 Blackdown > > Environment 2 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Windows 2000 Pro > RxTx : 2.0.7. > Java : 1.4.2_08 SUN > In my event/read/write test I found windows was ~20% faster than linux for some reason (strange part is Windows was in VMWare on the same Linux machine). It was about the same rxtx version. There are many problems with rxtx 1.4 with respect to commapi on windows but its code paths are more simple. What some people want from rxtx is perhaps better served by hacking up the very first release as they just want to read and write which is what rxtx was before Sun released commapi. It sounds like perhaps you are pushing out larger writes which will greatly improve results. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 11:16:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:16:49 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118161289.42a5c989cf6a2@imp4-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: On Tue, 7 Jun 2005 carobizar at free.fr wrote: > > Hello ! > > I am a french student and I have to create an application able to read and write > on serial and parallel port and to run on Windows and Linux. > For the moment my program run on Windows thanks the Java Communication API > (version for Microsoft Windows and Solaris/x86). > But it doesn't work on Linux. > > Does a recent version of an installation documentation exist ? > I didn't find one on the RXTX site (nothing for the windows installation and the > linux installation deals with a "jcl.jar" that I don't know...). > > So, I have some questions : > > 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 > version or Linux&w32 version ?) What are the differences between them ? Which > of them are the most stable ? > Use rxtx 2.0 with commapi for sparc solaris from Sun. If you want your current package javax.comm. > 2) Where have I to put the .so and .dll files ? On Linux just use the source, the configure script will do all of that for you. tar -xzvf rxtx-2.0-version mkdir rxtx-2.0-version/build cd rxtx-2.0-version/build ../configure && make install It will do everything for you. With Windows, you need to create the javax.comm.properties and install the DLL on your path. But you can just use Sun's package too. They are intended to be interchangable. > > 3) What have I to write on the file javax.comm.properties ? Driver=gnu.io.RXTXCommDriver More documentation in INSTALL that comes with the source. Sun's documentation should work too. configure does this for you on Linux. > > 4) Have I to delete the file win32comm.dll included in the Java Comm API ? > No > 5) Have I to keep both comm.jar and RXTXcomm.jar ? > Yes. RXTX 2.1 replaces comm.jar but the package is different (gnu.io) to avoid contaminating Sun's namespace. With rxtx 2.0 you need Sun's comm.jar - they work together. > > Best regards, > Caroline. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Tue Jun 7 12:07:34 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 14:07:34 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 Message-ID: <20050607180632.1543A29D5C8@mail.electronpusher.org> Hello, I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our product includes a built in USB to Serial adapter so that when it is connected to your PC over USB, it appears as a serial port. We had problems with Sun's comm library because it did not detect serial ports coming and going properly. I did run into a few issues with RxTx though. I am building under Windows (we support XP and 2000) under cygwin. I used a simple make file for the c code that works under cygwin and ant to build the java stuff. Attached is a diff file. The patches hit the following issues: ParallelImp.c - I am not using config so there is no config.h for me. Also, gcc didn't like a local file (win32termios.h) getting included with <> . RXTXPort.java - You can get an exception during the writeByte, writeArray, nativeDrain, readByte, read, readArray, readTerminatedArray, and nativeAvailable calls. Without this patch the IOLocked count gets stuck incremented. termios.c - If you try to open a port through CreateFile and get ERROR_ACCESS_DENIED it means someone else is using the port. We need to make sure to use serial_close instead of just close. I found that some devices finish their I/O synchronously. The code was treating this as an error. I also added some checking on the ClearError calls. I found a compile error when debugging is turned on (see the usleep change). SerialImp.c - Again, I don't have a config.h and again we must use quotes and not <> to include win32termios.h . I also commented out a report call since it seems to happen constantly on my system. Feel free to use these in any way that you want or just to ignore them. Thanks! -Dave Acker dacker at nomadio.net Software Engineer Nomadio, Inc. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diffs.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/5671d159/diffs-0001.txt From jon.nall at gmail.com Tue Jun 7 12:28:16 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 13:28:16 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, DEBIEF Eric wrote: > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. Hi. This is helpful, thanks. I can think of 2 reasons I'm not collecting the data as fast as I think I should be: 1) the device to PC connection is not at 100% utilization 2) my SerialPortEventListener processing has too much overhead Are there other explanations I might be missing as to why it takes so long to transfer the data? Thanks. nall. From taj at www.linux.org.uk Tue Jun 7 13:21:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:21:46 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > On 6/7/05, DEBIEF Eric wrote: > > We are "pushing" RxTx /Java here in a half-duplex link. > > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > > and application handling) about 25?s/byte. > > The figures are the barely the same on two environments. > > Hi. > This is helpful, thanks. I can think of 2 reasons I'm not collecting > the data as fast as I think I should be: > 1) the device to PC connection is not at 100% utilization > 2) my SerialPortEventListener processing has too much overhead > > Are there other explanations I might be missing as to why it takes so > long to transfer the data? > Polling the port would probably make more sense. You can set the threshold/timeouts to avoid racing and not deal with the event notification. As mentioned earlier I think the event latency is ~10ms. Keep the event listener around, rxtx 2.* does not close well without it. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 13:27:27 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 14:27:27 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, Trent Jarvi wrote: > Polling the port would probably make more sense. You can set the > threshold/timeouts to avoid racing and not deal with the event > notification. As mentioned earlier I think the event latency is ~10ms. Trent, Thanks for the response. Just to make sure I understand what you're talking about, when you say event latency, do you mean the time it takes from when the byte hits the PC's comm port to when rxtx presents it to user code? So if the link is 100% utilized, will my user code see "hiccups" or a steady stream of data? Thanks for helping a serial port newbie. nall. From dacker at nomadio.net Tue Jun 7 13:32:20 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 15:32:20 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <20050607193118.5499329CAA0@mail.electronpusher.org> Some folks asked about the make file and ant steps. I have JAVA_HOME set as follows: $ echo $JAVA_HOME C:\Program Files\Java\jdk1.5.0_01 I have all the code in rxtx/src put into gnu/io . The make file here doesn't have optimizations turned on. We have not tested with it yet. --------------Begin Makefile------------------ CPPFLAGS="-I$(JAVA_HOME)/include" "-I$(JAVA_HOME)/include/win32" SOBJECTS=SerialImp.o fuserImp.o termios.o fixup.o init.o POBJECTS=ParallelImp.o termios.o init.o DLLS=rxtxParallel.dll rxtxSerial.dll all: $(CLASSES) $(DLLS) rxtxSerial.dll: $(SOBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(SOBJECTS) rxtxParallel.dll: $(POBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(POBJECTS) clean: rm -fv $(SOBJECTS) $(POBJECTS) $(DLLS) %.o: %.c gcc -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< %.o: %.cpp g++ -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< --------------End Makefile------------------ Here is the ant target I use to build the rxtx libs. Our build puts the class files in a bin dir. We copy the dlls to a deploy dir and to the build dir. Eclipse seems to like the dlls in the build dir. The deploy dir is used when we build our full package. --------------Begin Ant Section------------------ --------------End Ant Section------------------ > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > David S. Acker > Sent: Tuesday, June 07, 2005 2:08 PM > To: 'Java RXTX discussion' > Subject: [Rxtx] Patches to 2.1-7pre17 > > Hello, > I am using RxTx with the Nomadio Sensor, > http://www.nomadio.net/ . Our product includes a built in > USB to Serial adapter so that when it is connected to your PC > over USB, it appears as a serial port. We had problems with > Sun's comm library because it did not detect serial ports > coming and going properly. > > I did run into a few issues with RxTx though. I am building > under Windows (we support XP and 2000) under cygwin. I used > a simple make file for the c code that works under cygwin and > ant to build the java stuff. Attached is a diff file. The > patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h > for me. Also, gcc didn't like a local file (win32termios.h) > getting included with <> . > > RXTXPort.java - You can get an exception during the > writeByte, writeArray, nativeDrain, readByte, read, > readArray, readTerminatedArray, and nativeAvailable calls. > Without this patch the IOLocked count gets stuck incremented. > > termios.c - If you try to open a port through CreateFile and > get ERROR_ACCESS_DENIED it means someone else is using the > port. We need to make sure to use serial_close instead of > just close. I found that some devices finish their I/O > synchronously. The code was treating this as an error. I > also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we > must use quotes and not <> to include win32termios.h . I > also commented out a report call since it seems to happen > constantly on my system. > > Feel free to use these in any way that you want or just to > ignore them. > Thanks! > > -Dave Acker > dacker at nomadio.net > Software Engineer > Nomadio, Inc. > From taj at www.linux.org.uk Tue Jun 7 13:37:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:37:45 +0100 (BST) Subject: [Rxtx] Re: Stack Smashing Attack In-Reply-To: <200506072012.48860.ferdinand.tatzig@web.de> References: <200506072012.48860.ferdinand.tatzig@web.de> Message-ID: On Tue, 7 Jun 2005, Ferdinand Tatzig wrote: > Dear Trent > > I am using RXTX for serial port communication between a PC and a payment > transaction terminal. > When I run my application under Windows 2000, an i386-Linux or an i386-FreeBSD > it works as I expect it to do. However, when I start it to run on AMD64 > machine with a 64-bit Gentoo Linux, the VM terminates with the following > error: > > Port found: /dev/ttyS0 > java: stack smashing attack in function configure_port() > > I am using a 64-bit Blackdown-1.4.2-01 VM. > > I have searched the internet but have found no information about this error. > > This is the code of the method which initializes the serial port: > > /** > * initializes a serial port for communication with a terminal; only > * accessible within this class > * > * @param communication > * @param serialPortToBeInitialized > * @param tillInterfaceEventListener > */ > private TillInterfaceSerialPort(Communication communication, > String serialPortToBeInitialized, > TillInterfaceEventListener tillInterfaceEventListener) > throws IOException, PortInUseException, > TillInterfaceSerialPortNotFoundException, > TooManyListenersException, UnsupportedCommOperationException { > serialPortName = "not initialized yet"; > CommPortIdentifier portId = null; > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > boolean portFound = false; > String temporarySerialPortName = "not initialized yet"; > > // look for a serial port > while (portList.hasMoreElements() && !portFound) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > temporarySerialPortName = portId.getName(); > if (temporarySerialPortName.equals(serialPortToBeInitialized)) { > System.out.print("Port found: "); > System.out.println(temporarySerialPortName); > serialPortName = temporarySerialPortName; > portFound = true; > } > } > } > if (portFound) { > > // initialize the found port - this command causes the VM to terminate > serialPort = (SerialPort) portId > .open( > TillInterfaceConstants.APPLICATION_NAME, > TillInterfaceConstants > .TIMEOUT_IN_MILLISECONDS_FOR_OPENING_OF_COMMUNICATION_PORT); > > // add an event listener which listens > // on the serial port and notifies the > // serial port object when input bytes > // have been received at the port > serialPort.addEventListener(tillInterfaceEventListener); > serialPort.notifyOnDataAvailable(true); > > // initialize the physical layer > // parameters of the serial port > serialPort.setSerialPortParams(TillInterfaceConstants.BAUD_RATE, > SerialPort.DATABITS_8, SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > // set the inter-character > // timeout (T2) > serialPort > .enableReceiveTimeout(TillInterfaceConstants.INTERCHARACTER_TIMEOUT_IN_MILLISECONDS); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > } else > throw new TillInterfaceSerialPortNotFoundException(); > } > > Any hint to solve this problem would be kindly appreciated. > The only thing that comes to mind here after looking at the offending function is rxtx used to include asm/termios.h but now we moved to termios.h and had glibc fix their headers. The asm/termios.h caused problems as its termios was smaller than the actual termios. This should be fixed in current rxtx versions but you can just glance at SerialImp.c and make sure it does not include asm/termios.h. I've cc'd the rxtx mail list because there was one other mention of stack problems recently. I have used rxtx on opteron systems with success. I have a bug I'm trying hard to reproduce on suse 64 bit (circa linux 2.4.19) systems though. So far I have not been able to reproduce the bug. That said, with gentoo... I like gentoo but I seriously doubt they do any QA with their kernel and Java. I've seen problems before. If you use gentoo and have Java problems, at least stick to Linus (that is an s there) kernels while using Java. I'm not an expert on gentoo but I've seen patches go into experimental kernels that turn out to break java and are reverted before going to Linus just before I see problems with gentoo on this list. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:16:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:16:14 +0100 (BST) Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: On Tue, 7 Jun 2005, David S. Acker wrote: > Hello, > I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our > product includes a built in USB to Serial adapter so that when it is > connected to your PC over USB, it appears as a serial port. We had problems > with Sun's comm library because it did not detect serial ports coming and > going properly. > > I did run into a few issues with RxTx though. I am building under Windows > (we support XP and 2000) under cygwin. I used a simple make file for the c > code that works under cygwin and ant to build the java stuff. Attached is a > diff file. The patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h for me. Also, > gcc didn't like a local file (win32termios.h) getting included with <> . > > RXTXPort.java - You can get an exception during the writeByte, writeArray, > nativeDrain, readByte, read, readArray, readTerminatedArray, and > nativeAvailable calls. Without this patch the IOLocked count gets stuck > incremented. > > termios.c - If you try to open a port through CreateFile and get > ERROR_ACCESS_DENIED it means someone else is using the port. We need to > make sure to use serial_close instead of just close. I found that some > devices finish their I/O synchronously. The code was treating this as an > error. I also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we must use quotes > and not <> to include win32termios.h . I also commented out a report call > since it seems to happen constantly on my system. > > Feel free to use these in any way that you want or just to ignore them. > Thanks! > Hi Dave These patches look great as is. Thanks. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:33:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:33:16 +0100 (BST) Subject: [Rxtx] Patch to IOLocked (fwd) Message-ID: This appears to be another solution to the locking. Chris, the other option just moves the locking into the finally clause which I think would be a little cleaner though I'm posting this patch to so people can comment. -- Trent Jarvi tjarvi at qbang.org ---------- Forwarded message ---------- Date: Wed, 1 Jun 2005 13:01:32 +0100 From: Christopher Dawes To: taj at www.linux.org.uk Subject: Patch to IOLocked Do you want me to check it out of CVS and then submit changes? Christopher -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXPort.java.diff Type: application/octet-stream Size: 6965 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/c442f9fc/RXTXPort.java-0001.obj From Christopher.Dawes at retail-logic.com Wed Jun 8 00:57:24 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 8 Jun 2005 07:57:24 +0100 Subject: [Rxtx] Patch to IOLocked (fwd) [Virus Checked] In-Reply-To: Message-ID: Agreed, much better Java :-) Thanks Christopher ------------------------------------------- Consultant Engineer Retail Logic Limited Fleet GU51 3TZ Tel: +44 (0)1252 644377 Mob: +44 (0)7899 842759 Fax: +44 (0)1252 776708 rxtx-bounces at mail.electronpusher.org wrote on 07/06/2005 21:33:16: > > This appears to be another solution to the locking. Chris, the other > option just moves the locking into the finally clause which I think would > be a little cleaner though I'm posting this patch to so people can > comment. > > -- > Trent Jarvi > tjarvi at qbang.org > > ---------- Forwarded message ---------- > Date: Wed, 1 Jun 2005 13:01:32 +0100 > From: Christopher Dawes > To: taj at www.linux.org.uk > Subject: Patch to IOLocked > > Do you want me to check it out of CVS and then submit changes? > > Christopher[attachment "RXTXPort.java.diff" deleted by Chris > Dawes/Retaillogic/NISABA] _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx From zempftman at gmail.com Wed Jun 8 07:57:25 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 09:57:25 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Maxwell Zempftman Date: May 27, 2005 5:01 PM Subject: Re: [Rxtx] Kaffe & rxtx & armv5b To: rxtx at mail.linuxgrrls.org Here are the results from working this week: The "NullPointerExceptions" are generated by the software when I choose a bad device file. I discovered that this occurs on the i686-RedHat box as well. This exception seems to be generated only by this particular application, and not by the example programs in contrib. So, for example: java MyApp /dev/null <-- generates NullPointerException java MyApp fake <-- generates NullPointerException java MyApp /dev/ttyS0 <-- does not generate NullPointerException Using the program CommCheck (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it appears as though /dev/ttyS0 is the only valid serial device file on the XScale device, so the errors I was getting are not really be bugs. Although /dev/ttyS0 did not generate NullPointerExceptions, I did encounter this error: --start java MyApp /dev/ttyS0 (going mostly from memory, not exact) PortList.hasMoreElements: true Listening on: /dev/ttyS0 Client connected. >From net: echo kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 vmExcept_setJNIFrame Assert: on 'fp != 0' failed. --end I took a look at exception.h, and it seems as though the problematic code does not exist in newer versions of Kaffe (I have been using CVS-2004-11). Next week I will try to use a newer version, although so far everything but CVS-2004-11 has failed. Also, I the device files I need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with something like this? Thanks, Max. > On 5/21/05, Trent Jarvi wrote: > > I'm not sure what is wrong in the first part. It sounds like your > > application may be swallowing an exception while trying to enumerate the > > port or open it. The usual mistake made it not having permissions to > > either open the port or create the lockfile. There should be examples in > > the contrib directory you can try that enumerate and open ports. Maybe > > that will give you some hints. > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > Sun's code limiting you there though you do need to compile and install > > rxtx for the XScale with Sun's Commapi. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > From taj at www.linux.org.uk Wed Jun 8 08:22:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 15:22:44 +0100 (BST) Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > ---------- Forwarded message ---------- > From: Maxwell Zempftman > Date: May 27, 2005 5:01 PM > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > To: rxtx at mail.linuxgrrls.org > > > Here are the results from working this week: > > The "NullPointerExceptions" are generated by the software when I > choose a bad device file. I discovered that this occurs on the > i686-RedHat box as well. This exception seems to be generated only by > this particular application, and not by the example programs in > contrib. So, for example: > > java MyApp /dev/null <-- generates NullPointerException > java MyApp fake <-- generates NullPointerException > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > Using the program CommCheck > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > appears as though /dev/ttyS0 is the only valid serial device file on > the XScale device, so the errors I was getting are not really be bugs. > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > encounter this error: > > --start > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > PortList.hasMoreElements: true > Listening on: /dev/ttyS0 > Client connected. > >From net: echo > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > --end > > I took a look at exception.h, and it seems as though the problematic > code does not exist in newer versions of Kaffe (I have been using > CVS-2004-11). Next week I will try to use a newer version, although so > far everything but CVS-2004-11 has failed. Also, I the device files I > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > something like this? > In RXTXCommDriver, just look for the following code and add /dev/ttyM to the list. Moxa? if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } So: if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyM", // for Moxa ports "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } Linux just has way too many port types to try enumerating them all. There is potential we can add them back in with udev now. > Thanks, > Max. > > > On 5/21/05, Trent Jarvi wrote: > > > I'm not sure what is wrong in the first part. It sounds like your > > > application may be swallowing an exception while trying to enumerate the > > > port or open it. The usual mistake made it not having permissions to > > > either open the port or create the lockfile. There should be examples in > > > the contrib directory you can try that enumerate and open ports. Maybe > > > that will give you some hints. > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > Sun's code limiting you there though you do need to compile and install > > > rxtx for the XScale with Sun's Commapi. > > > > > > -- > > > Trent Jarvi > > > tjarvi at qbang.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Wed Jun 8 12:16:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 08 Jun 2005 13:16:03 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A60B8D.8080500@cs.umn.edu> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> Message-ID: <42A735E3.8040706@atcorp.com> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual serial comport. This isn't so much of a problem, what is, however, is that the comport does not appear to be able to be set to any arbitrary speed, only those from the data_rate enum. I've not found much on using different speeds, has anyone else encountered anything similar? I greatly appreciate any and all comments and suggestions. Thanks in advance, ~ Shawn Lavelle From zempftman at gmail.com Wed Jun 8 12:50:58 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 14:50:58 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: Thanks Trent! That will solve one of the problems. I don't know when my next chance to work on it will be, but I still need to figure out the error I got when I tried opening '/dev/ttyS0' on the Moxa device regarding a failed assertion, seemed to be a Kaffe issue. Thanks for you help, hope to have results soon, Max Englander. On 6/8/05, Trent Jarvi wrote: > On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > > > ---------- Forwarded message ---------- > > From: Maxwell Zempftman > > Date: May 27, 2005 5:01 PM > > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > > To: rxtx at mail.linuxgrrls.org > > > > > > Here are the results from working this week: > > > > The "NullPointerExceptions" are generated by the software when I > > choose a bad device file. I discovered that this occurs on the > > i686-RedHat box as well. This exception seems to be generated only by > > this particular application, and not by the example programs in > > contrib. So, for example: > > > > java MyApp /dev/null <-- generates NullPointerException > > java MyApp fake <-- generates NullPointerException > > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > > > Using the program CommCheck > > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > > appears as though /dev/ttyS0 is the only valid serial device file on > > the XScale device, so the errors I was getting are not really be bugs. > > > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > > encounter this error: > > > > --start > > > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > > > PortList.hasMoreElements: true > > Listening on: /dev/ttyS0 > > Client connected. > > >From net: echo > > > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > > > --end > > > > I took a look at exception.h, and it seems as though the problematic > > code does not exist in newer versions of Kaffe (I have been using > > CVS-2004-11). Next week I will try to use a newer version, although so > > far everything but CVS-2004-11 has failed. Also, I the device files I > > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > > something like this? > > > > > In RXTXCommDriver, just look for the following code and add /dev/ttyM to > the list. Moxa? > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > So: > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyM", // for Moxa ports > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > Linux just has way too many port types to try enumerating them all. There > is potential we can add them back in with udev now. > > > > > Thanks, > > Max. > > > > > On 5/21/05, Trent Jarvi wrote: > > > > I'm not sure what is wrong in the first part. It sounds like your > > > > application may be swallowing an exception while trying to enumerate the > > > > port or open it. The usual mistake made it not having permissions to > > > > either open the port or create the lockfile. There should be examples in > > > > the contrib directory you can try that enumerate and open ports. Maybe > > > > that will give you some hints. > > > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > > Sun's code limiting you there though you do need to compile and install > > > > rxtx for the XScale with Sun's Commapi. > > > > > > > > -- > > > > Trent Jarvi > > > > tjarvi at qbang.org > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- > Trent Jarvi > tjarvi at qbang.org > From taj at www.linux.org.uk Wed Jun 8 12:53:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 19:53:10 +0100 (BST) Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A735E3.8040706@atcorp.com> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: On Wed, 8 Jun 2005, Shawn Lavelle wrote: > Hello, > I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate > with a virtual serial comport. This isn't so much of a problem, what > is, however, is that the comport does not appear to be able to be set to > any arbitrary speed, only those from the data_rate enum. I've not found > much on using different speeds, has anyone else encountered anything > similar? I greatly appreciate any and all comments and suggestions. > This problem is a bit more tricky than it should be. POSIX systems just have a few specified baud rates. Solaris is one of these systems. CommAPI baud rates probably came from someone looking at Solaris. RXTX tries to be POSIX like. W32 is treated as a POSIX like system via a termios.c file in rxtx. Serial ports have baudbase and divisor. So you can set these to come close to the baudrate you want. Some funky equipment like automobile test equipment use baud rates that are not really possible with PC hardware. But if you get as close as possible by changing baud base and divisor, it works. Windows can actually do this for you. I don't know exactly what their code does but if you pass a baudrate to windows, it will guestimate a baudbase and divisor. So you just pass it 10200 baud and it does its job. This is not of very much use the way rxtx does things though. Linux has the standard POSIX like baud rates but if you set the baud rate to B38400, you can set your own baud base and divisor. This is not POSIX that I know of. W32 has more capability than POSIX like systems too. So I did some work to have windows work like Linux via termios.c But the code is not quit right. SerialImp.c and termios.c need some work so all the various buadrates work on Linux and W32. Most other systems will not work beyond what CommAPI already specifies without writting kernel drivers. This is on my todo list but if someone gets to it first, all the better. -- Trent Jarvi tjarvi at qbang.org From carobizar at free.fr Thu Jun 9 06:39:10 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Thu, 9 Jun 2005 14:39:10 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: <1118320750.42a8386e6d3ce@imp5-q.free.fr> Hi ! Thank you for all your advices. I managed to use rxtx on Windows but I have still some difficulties on Linux. I have yet follow your instructions and the configure file has created : - librxtxSerial.so and librxtxParallel.so in the directory /usr/java/j2sdk1.4.2_08/jre/lib/i386 - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the directory /usr/java/j2sdk1.4.2_08/jre/lib - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext But when I run my program, Some exceptions occur : Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver So, 1) What have I forgotten ? 2) Is it possible to make my application run on Linux without the jdk (only the jre) ? Best regards, Caroline. From taj at www.linux.org.uk Thu Jun 9 07:28:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 9 Jun 2005 14:28:05 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118320750.42a8386e6d3ce@imp5-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: On Thu, 9 Jun 2005 carobizar at free.fr wrote: > Hi ! > Thank you for all your advices. > I managed to use rxtx on Windows but I have still some difficulties on Linux. > I have yet follow your instructions and the configure file has created : > - librxtxSerial.so and librxtxParallel.so in the directory > /usr/java/j2sdk1.4.2_08/jre/lib/i386 > - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the > directory /usr/java/j2sdk1.4.2_08/jre/lib > - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext > > But when I run my program, Some exceptions occur : > Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while > loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > com.sun.comm.SolarisDriver > > So, > 1) What have I forgotten ? > The native (.so) libraries are not installed in a directory the JRE is looking for native libraries in. You may look around and see where the .so libraries are in the JRE. I don't know that the jre/lib/i386 directory is specified as a required directory for JREs. I noticed some do not use it. You may try printing the java.libarary.path to see your options. It is also possible to alter the java.library.path. > 2) Is it possible to make my application run on Linux without the jdk (only the > jre) ? Yes. Though installation from source with the JDK is less error prone. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0001.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 7 15:03:09 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 07 Jun 2005 16:03:09 -0500 Subject: [Rxtx] Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <42A60B8D.8080500@cs.umn.edu> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual comport. This isn't so much of a problem, what is, however, is that the comport is only ever set to 9600 baud. I've not found this as a documented bug, has anyone else encountered anything similar? I'll try and provide more detail tomorrow, but if anyone has any suggestions or encountered this before, I'd like to hear about it. Thanks in advance, ~ Shawn Lavelle From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0001.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0001.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0001.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Mon Jun 20 01:04:40 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 20 Jun 2005 08:04:40 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: <42B66A88.4060806@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050620/9be208a1/attachment-0001.html From fbalzarro at libero.it Mon Jun 20 02:33:52 2005 From: fbalzarro at libero.it (Fabio Balzarro) Date: Mon, 20 Jun 2005 10:33:52 +0200 Subject: [Rxtx] RXTXPort:close detected bad file descriptor Message-ID: I'm using RXTX libraries on IPAQ 4150 PDA with Windows CE 4.20 and Jeode. When I close a serial port with sp.close() (where sp is a SerialPort) sometimes an error occour 1119256168085: RXTXPort:close detected bad file descriptor What can I do? Thanks Fabio ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From slavelle at atcorp.com Mon Jun 20 08:08:19 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 20 Jun 2005 09:08:19 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: <42B6CDD3.4040409@atcorp.com> It turns out that I did have a driver-not-used issue which has now been resolved and I can use RxTx on it (had to add ttyUSB as a valid port), but only at standard baud rates. Does USB have the same restrictions on port speed as regular RS232? ~ Shawn Trent Jarvi wrote: > Just a note here. > > I have requested a FTDI usb device and they offered to send one for the > purpose of trying to get rxtx working. I have no idea how long that takes > though. > > > On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > > >>I'm afraid we're just using the latest version from the FTDI website. I've >>not yet played with linux properly with this and unfortunately I run gentoo >>and haven't yet successfully compiled in the ftdi driver. I'll let you know >>if I get any success. >> >>Appologies >> >>Christopher >> >>-----Original Message----- >>From: rxtx-bounces at mail.electronpusher.org >>[mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle >>Sent: 15 June 2005 00:00 >>To: Java RXTX discussion >>Subject: Re: [Rxtx] Virtual Com Ports >> >>Hmm, the latter sounds like a lot of work. It does find the virtual comport >>in windows, i must have just missed it earlier (sign of a long day). On the >>linux side, I suspect that something is not correct with the driver >>installation becuase it does not give me a tty for it :( >> >>Christopher, May I ask what driver you are using for your FTDI chip? >>Did you ever encounter problems with not getting a tty assigned for it? >> >> >> Thanks for all your help! >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>They will have to show up as a tty device in Linux. Probably ttyUSB? >>>That will need an entry in RXTXCommDriver.java. If they dont show up >>>as a tty device, rxtx cant treat it like a serial port. It just wont >> >>work. >> >>>With COM3, rxtx will try to open the port and perform a timed out read. >>>Usually if a port is not there, the read blows up or the open blows up. >>>Timing out is fine. COM3 used to share interrupts with COM1. I know >>>you can reassign ports in XP. RXTX scans up through COM255. You may >>>try moving it. >>> >>> >>>The code in question is the following in RXTXCommDriver.java >>> >>> >>> if(osName.equals("Linux")) >>> { >>> String[] Temp = { >>> "ttyS", // linux Serial Ports >>> "ttySA", // for the IPAQs >>> "ttyUSB" // for USB frobs >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>> else if(osName.toLowerCase().indexOf("windows") != -1 ) >>> { >>> String[] Temp = { >>> "COM" // win32 serial ports >>> //"//./COM" // win32 serial ports >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>>If COM3 can be read, it should be found. the ttyUSB should work if >>>thats in the version of RXTXCommDriver.java you have. >>> >>>If this is still a problem, it may be that the driver is erroring on >>>what may be considered normal comm port operations such as setting the >>>speed, timeout, threshold, .. One would have to start looking at each >>>function called in the native open() and read(). >>> >>> >>> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>>seems to find the device using rxtx. Looking at the hardware >>>>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>>>linux. I can't seem to get it to show up as a tty(s#) in linux which >>>>is probably just due to my lack of significant linux knowledge. >>>> >>>> ~ Shawn >>>> >>>>Trent Jarvi wrote: >>>> >>>> >>>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>Has anyone here noticed that virtual comports do not get enumerated >>>>>>via CommPortIdentifier.getPortIdentifiers()?? >>>>>> >>>>>>The device I'm trying to talk to uses an fdti usb to serial >>>>>>convertor with a driver that has it show up as a virtual comport. I >>>>>>can enter this port manually and it will be usable but I cannot get >>>>>>it show up automatically (as in the simple serial demo). Any thoughts >> >>on this? >> >>>>> >>>>>Hi Shawn, >>>>> >>>>>What OS is this and what is the name of the virtual port you are >>>>>trying to open? I suspect the name just needs to be added to >> >>RXTXCommDriver.java. >> >>>>_______________________________________________ >>>>Rxtx mailing list >>>>Rxtx at mail.electronpusher.org >>>>http://www.electronpusher.org/mailman/listinfo/rxtx >>>> >>> >>> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From lyon at docjava.com Mon Jun 20 15:06:08 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 20 Jun 2005 17:06:08 -0400 Subject: [Rxtx] testing Message-ID: Hi All, I am testing my new multi-platform Java Webstart RXTX application (Trent: I could not have done it without you!). So far, I think it will work under Linux (x86), Windows XP, Windows 2000 and MacOS X. The application is available as a Java webstart application at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Edit:Preferences: SerialPort Setup... should bring up a dialog box that enables dialing via the modem. Generally, it does not find internal modems (except on the mac). Why, I don't know. Thanks in advance for trying this new app. All feedback on it is welcome. - Doug Lyon From jasmine at electronpusher.org Tue Jun 21 04:15:53 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Tue, 21 Jun 2005 11:15:53 +0100 Subject: [Rxtx] testing In-Reply-To: References: Message-ID: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > Hi All, > I am testing my new multi-platform Java Webstart RXTX application > (Trent: I could not have done it without you!). > > So far, I think it will work under Linux (x86), Windows XP, > Windows 2000 and MacOS X. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. -J. From taj at www.linux.org.uk Tue Jun 21 05:50:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 12:50:23 +0100 (BST) Subject: [Rxtx] testing In-Reply-To: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> References: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> Message-ID: On Tue, 21 Jun 2005, Jasmine Strong wrote: > > On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > > > Hi All, > > I am testing my new multi-platform Java Webstart RXTX application > > (Trent: I could not have done it without you!). > > > > So far, I think it will work under Linux (x86), Windows XP, > > Windows 2000 and MacOS X. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > on my Mac. > passing -source 1.3 -target 1.3 to javac will compile classes without this problem. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 10:19:25 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 11:19:25 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. Sincerely, Jeremyah Payne From ricardo.trindade at emation.pt Tue Jun 21 13:25:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 20:25:00 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B8698C.2060509@emation.pt> Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > From taj at www.linux.org.uk Tue Jun 21 13:39:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:39:43 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <42B8698C.2060509@emation.pt> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> <42B8698C.2060509@emation.pt> Message-ID: It looks like he has an rs422 device/converter. This is not the problematic 'trying to do protocol X with a serial port' situation unless I'm missing something. I'll follow up with the other email I started. On Tue, 21 Jun 2005, Ricardo Trindade wrote: > Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. > > Payne, Jeremyah L (N-CIM) wrote: > > >Good morning, my name is Jeremyah and I am working on a java project to > >interface with some devices. In short, I have a laptop with a PCMIA > >converter that does RS422 running windows 2000. I also will be > >installing some PCI cards into some Linux boxes that will have probably > >4-8 RS422 ports on them. After doing some reading in order to talk > >with these items using my existing java code I will need an additional > >driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > >trying to get a map sort of where I need to make changes. As I see it, > >I would need to subclass SerialPort to my RS422 interface. That would > >link with a DLL or SO implementation that talks with the hardware. I > >also need to change the listing of working ports in the lookup section > >for serial. Does this seem like I am on the right track? Appreciate > >the support. > > > > > >Sincerely, > >Jeremyah Payne > >_______________________________________________ > >Rxtx mailing list > >Rxtx at mail.electronpusher.org > >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 21 13:40:25 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:40:25 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: On Tue, 21 Jun 2005, Payne, Jeremyah L (N-CIM) wrote: > Good morning, my name is Jeremyah and I am working on a java project to > interface with some devices. In short, I have a laptop with a PCMIA > converter that does RS422 running windows 2000. I also will be > installing some PCI cards into some Linux boxes that will have probably > 4-8 RS422 ports on them. After doing some reading in order to talk with > these items using my existing java code I will need an additional > driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > trying to get a map sort of where I need to make changes. As I see it, I > would need to subclass SerialPort to my RS422 interface. That would link > with a DLL or SO implementation that talks with the hardware. I also > need to change the listing of working ports in the lookup section for > serial. Does this seem like I am on the right track? Appreciate the > support. > Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 13:40:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 14:40:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618954@emss02m08.us.lmco.com> I'd like to except I am dealing with NASA. I am basically building a system to monitor 100+ Units that communicate over RS422. They have some converters in place but want to get rid of them. I'll check through the archives. I had started looking yesterday as was leaving work. -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Ricardo Trindade Sent: Tuesday, June 21, 2005 2:25 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From slavelle at atcorp.com Tue Jun 21 14:58:06 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 21 Jun 2005 15:58:06 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: <42B87F5E.4000403@atcorp.com> > Linux has the standard POSIX like baud rates but if you set the baud rate > to B38400, you can set your own baud base and divisor. This is not POSIX > that I know of. W32 has more capability than POSIX like systems too. So > I did some work to have windows work like Linux via termios.c > > But the code is not quit right. SerialImp.c and termios.c need some > work so all the various buadrates work on Linux and W32. Most other > systems will not work beyond what CommAPI already specifies without > writting kernel drivers. > > This is on my todo list but if someone gets to it first, all the better. Hmm, I guess I didn't read this close enough before. Just to be clear, the pieces to setBaudBase and setDivisor are not yet implemented, correct? Thanks, Shawn From sean_montgomery at baseview.com Tue Jun 21 15:14:08 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 21 Jun 2005 17:14:08 -0400 Subject: [Rxtx] OS X installation - file locations Message-ID: <8AB82C7F-0D19-45F9-AE54-A12C59A8495E@baseview.com> Greetings, I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) using the RXTX installation instructions. RXTX worked fine. Basically you've got: - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions - javax.comm.properties in /System/Library/Frameworks/ JavaVM.framework/Home/lib - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ lib/ext My coworker was concerned that the installation required files to be placed in /System/Library... because those directories are "Apple's" and subject to change at Apple's whim, and that it would be safer (less likely to break when a user updates their OS or Java version or what have you) if all the files could be somewhere in /Library... or / Library/Java. My coworker points out that when 3rd party apps like FrontBase and JBoss need to communicate with Java their jars are placed in /Library/Java/Extensions. Granted that RXTX 2.0 is implementing javax.comm and not just a 3rd party extension, might that be the case - that javax.* stuff needs to be in the Java system files? I'm not the Java maven that my coworker is, so I don't know if any of this is gospel or not. Any OS X/Java experts out there willing to comment? We'd like to be able to install RXTX in the safest, most maintenance free way possible, but if there are specific reasons why javax.comm.properties and comm.jar need to be in /System... then so be it. Any information is welcome, Sean From ricardo.trindade at emation.pt Tue Jun 21 15:56:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 22:56:53 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B88D25.7060604@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050621/f6c9f5fe/attachment-0001.html From jeremyah.l.payne at lmco.com Tue Jun 21 15:22:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 16:22:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618955@emss02m08.us.lmco.com> -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Trent Jarvi Sent: Tuesday, June 21, 2005 2:40 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 As of yet we have not decided on the PCI boards to use yet So I am still waiting to se how we will interface to them. But the laptop is ready to use so ill build a test app for that API for now. The overview of class structure is really what I needed. I guess I will use the 2.1 as you suggested. Thanks for the help thus far! BTW, you guys wouldn't happen to keep class diagrams or anything of that nature around would you? If not I will probably end up having to do some anyway for documentation purposes, I could include them. Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From dmarkman at mac.com Tue Jun 21 18:13:28 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 21 Jun 2005 20:13:28 -0400 Subject: [Rxtx] OS X installation - file locations In-Reply-To: References: Message-ID: <044F520C-585C-4B99-82ED-3BA83DB8CE77@mac.com> Apple doesn't recommend to put jars into the /System/Library/Frameworks/JavaVM.framework/Home/lib/ext folder from other hands it's standard java directory to put extentions if you want to support comm api on whole system then I'd recommend to put jars into the /Library/Java/Extensions folder just like you did if you want to support comm api per user put your jars into the ~/ Library/Java/Extensions On Jun 21, 2005, at 5:14 PM, Java RXTX discussion wrote: > Greetings, > > > I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) > using the RXTX installation instructions. RXTX worked fine. > > > Basically you've got: > - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions > - javax.comm.properties in /System/Library/Frameworks/ > JavaVM.framework/Home/lib > - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ > lib/ext > > > My coworker was concerned that the installation required files to be > placed in /System/Library... because those directories are "Apple's" > and subject to change at Apple's whim, and that it would be safer > (less likely to break when a user updates their OS or Java version or > what have you) if all the files could be somewhere in /Library... or / > Library/Java. My coworker points out that when 3rd party apps like > FrontBase and JBoss need to communicate with Java their jars are > placed in /Library/Java/Extensions. Granted that RXTX 2.0 is > implementing javax.comm and not just a 3rd party extension, might > that be the case - that javax.* stuff needs to be in the Java system > files? > > > I'm not the Java maven that my coworker is, so I don't know if any of > this is gospel or not. Any OS X/Java experts out there willing to > comment? We'd like to be able to install RXTX in the safest, most > maintenance free way possible, but if there are specific reasons why > javax.comm.properties and comm.jar need to be in /System... then so > be it. > > > Any information is welcome, > > > Sean > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Dmitry Markman Dmitry Markman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050622/beea65d0/attachment-0001.html From lyon at docjava.com Thu Jun 23 04:39:47 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 23 Jun 2005 06:39:47 -0400 Subject: [Rxtx] web start + RXTX = strange errors? Message-ID: On: Date: Tue, 21 Jun 2005 11:15:53 +0100 From: Jasmine Strong Writes: An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. ----------- I cannot duplicate your error. My version of Java is: java -version java version "1.4.2_05" Is yours the same? Trent: You wrote: passing -source 1.3 -target 1.3 to javac will compile classes without this problem. ----------- OK, I have updated the disto to work with jdk1.3: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Jasmine: Is this working any better? Thanks! - DL From handzisk at tkn.tu-berlin.de Fri Jun 24 02:37:14 2005 From: handzisk at tkn.tu-berlin.de (Vlado Handziski) Date: Fri, 24 Jun 2005 10:37:14 +0200 (CEST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace Message-ID: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Hi all, let me first express my compliments on the great work you have done with the RXTX library. We have been using the library for some time, and we are at a point where we want to make our code public. For legacy reasons, the code that the RXTX library is bundled with, uses the javax.comm namespace. We have been using the ChangePackage script to change the RXTX2.1 package from gnu.io into javax.comm. We need the independent implementation since we want to be able to directly access /dev/ttyUSBx ports in linux and the CommAPI versions are just not as stable. On the download page, there is a comment that this is in violation of sun's license. Can someone shed more light on this. I was not aware that you can protect the names of the java packages. Best regards, Vlado From ricardo.trindade at emation.pt Fri Jun 24 04:01:17 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 11:01:17 +0100 Subject: [Rxtx] parity missed Message-ID: <42BBD9ED.3060004@emation.pt> Hi, I have a "parity missed error". From previous posts I believe this has to do with CMSPAR not being defined. I checked out 2.1 head from CVS. How can I make sure I do a proper build and CMSPAR is defined ? Perhaps it would be good to have a release snapshot that has this, I think the latest snapshot (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. Another question I have, is why must this depend on kernel headers, why can't it be defined in the RXTX source ? thanks Ricardo From jasmine at electronpusher.org Fri Jun 24 04:09:06 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 24 Jun 2005 11:09:06 +0100 Subject: [Rxtx] web start + RXTX = strange errors? In-Reply-To: References: Message-ID: <644aad2bdbba950f0a2fb12d7dcfd8a6@electronpusher.org> On 23 Jun 2005, at 11:39, Dr. Douglas Lyon wrote: > OK, I have updated the disto to work with jdk1.3: > http://show.docjava.com:8086/book/cgij/code/jnlp/ > addbk.JAddressBook.Main.jnlp > > Jasmine: Is this working any better? Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) -J. From taj at www.linux.org.uk Fri Jun 24 10:54:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 17:54:12 +0100 (BST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: On Fri, 24 Jun 2005, Vlado Handziski wrote: > Hi all, > > let me first express my compliments on the great work you have done with > the RXTX library. > > We have been using the library for some time, and we are at a point where > we want to make our code public. For legacy reasons, the code that the > RXTX library is bundled with, uses the javax.comm namespace. We have been > using the ChangePackage script to change the RXTX2.1 package from gnu.io > into javax.comm. We need the independent implementation since we want to > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > versions are just not as stable. > > On the download page, there is a comment that this is in violation of > sun's license. Can someone shed more light on this. I was not aware that > you can protect the names of the java packages. > > Best regards, > Vlado > I can't provide legal advice as I am not a lawyer. (v) may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are contained in the "java", "javax" or "sun" packages or similar as specified by Sun in any class file naming convention; and The license is in the commapi package from Sun. The above is also in all the EULA's you click through to download from Sun if I'm not mistaken. Simply put, the license taints developers that agree to it. For those developers, Sun has control of the javax.comm namespace. It really does not make sense to put rxtx 2.1 in the javax.comm namespace. It will only cause confusion which I think is the point of the clause above. The gnu.io namespace was perhaps a poor choice and just tossed in when reviewing the license to get out of Sun's namespace. There is nothing in the rxtx license limiting your freedom in this fashion though. Many companies are moving to gnu.io and some distribute it with popular applications you would recognize. I'm tempted to ask you not to contaminate rxtx 2.1 with the javax.comm namespace. You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) extensions to existing classes (which I dont think you are using); it is not just javax.comm. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 24 13:24:09 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 20:24:09 +0100 (BST) Subject: [Rxtx] parity missed In-Reply-To: <42BBD9ED.3060004@emation.pt> References: <42BBD9ED.3060004@emation.pt> Message-ID: On Fri, 24 Jun 2005, Ricardo Trindade wrote: > Hi, > > I have a "parity missed error". From previous posts I believe this > has to do with CMSPAR not being defined. > I checked out 2.1 head from CVS. How can I make sure I do a proper > build and CMSPAR is defined ? Perhaps it would be good to have a release > snapshot that has this, I think the latest snapshot > (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. > > Another question I have, is why must this depend on kernel headers, > why can't it be defined in the RXTX source ? > I used to cheat and grab the CMSPAR from the kernel headers because glibc did not have it. Now rxtx uses the glibc headers and we have a patch in glibc I trust that handles this. It would not be right to override glibc and it wasnt right to use the kernel headers (it really did cause problems). You can override glibc for now with the following in the top of SerialImp.c # define CMSPAR 010000000000 You can check if your distro headers have this right bit looking for the above in bits/termios.h. It should look like this: #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif If it is not defined, please file a bug with your distro as rxtx is not the only thing that will be broken on that distro. I was going to release new cvs snapshots last weekend but got tied up. I'll do it this weekend. I also need to get custom baudrate patches into the cvs snapshot. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Fri Jun 24 13:56:50 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 20:56:50 +0100 Subject: [Rxtx] parity missed In-Reply-To: References: <42BBD9ED.3060004@emation.pt> Message-ID: <42BC6582.2070805@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050624/e3b39631/attachment-0001.html From vlado.handziski at gmail.com Sat Jun 25 06:25:52 2005 From: vlado.handziski at gmail.com (Vlado Handziski) Date: Sat, 25 Jun 2005 14:25:52 +0200 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: <697986ec05062505256ebf381f@mail.gmail.com> Thanks for the clarification. Since changing the bundled source is not an option at this moment, we will consider using javax.comm and RXTX2.0. In the next rewrite, we would probably move to gnu.io . Best regards, Vlado Handziski On 6/24/05, Trent Jarvi wrote: > > On Fri, 24 Jun 2005, Vlado Handziski wrote: > > > Hi all, > > > > let me first express my compliments on the great work you have done with > > the RXTX library. > > > > We have been using the library for some time, and we are at a point > where > > we want to make our code public. For legacy reasons, the code that the > > RXTX library is bundled with, uses the javax.comm namespace. We have > been > > using the ChangePackage script to change the RXTX2.1 package from gnu.io > > into javax.comm. We need the independent implementation since we want to > > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > > versions are just not as stable. > > > > On the download page, there is a comment that this is in violation of > > sun's license. Can someone shed more light on this. I was not aware that > > you can protect the names of the java packages. > > > > Best regards, > > Vlado > > > > I can't provide legal advice as I am not a lawyer. > > (v) may not create, or authorize your licensees to create additional > classes, interfaces, or subpackages that are contained in the "java", > "javax" or "sun" packages or similar as specified by Sun in any class file > naming convention; and > > The license is in the commapi package from Sun. The above is also in all > the EULA's you click through to download from Sun if I'm not mistaken. > > Simply put, the license taints developers that agree to it. For those > developers, Sun has control of the javax.comm namespace. > > It really does not make sense to put rxtx 2.1 in the javax.comm namespace. > It will only cause confusion which I think is the point of the clause > above. The gnu.io namespace was perhaps a poor choice and > just tossed in > when reviewing the license to get out of Sun's namespace. > > There is nothing in the rxtx license limiting your freedom in this fashion > though. Many companies are moving to gnu.io and some > distribute it with > popular applications you would recognize. I'm tempted to ask you not > to contaminate rxtx 2.1 with the javax.comm namespace. > > You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm > using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) > extensions to existing classes (which I dont think you are using); it is > not just javax.comm. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050625/1dadc50e/attachment-0001.html From taj at www.linux.org.uk Sun Jun 26 11:34:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 26 Jun 2005 18:34:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. Message-ID: The attached file should fix baud_base and divisor extensions for Linux The patch is against rxtx 2.1 CVS HEAD. To use this patch, you should set the baud rate to 38400. You can then try SerialPort.setBaudBase(int) and SerialPort.setDivisor(int) There are matching int SerialPort.getBaudBase() and int SerialPort.getDivisor(). What baud bases are available depends upon the serial port card and its driver so this is a bit of a blind attempt on my part. I've looked at the w32 API and I dont see anything available yet. The w32 code in RXTX will probably be figuring out the baud rate based on the tried baud base and divisor and just slamming it at the API for now (the API does something with that but I've not found real documentation on what it does). I dont want to try tinkering with the UART directly yet as that would involve poking machine memory directly and could very easily be error prone in bad ways. I don't expect Solaris or any SysV UNIX systems to work at all with this - ever. It is not standard in any way and will throw Exceptions on everything but Linux (w32 will just fail miserably as it is 1/2 implemented). If anyone has looked at custom baud rates before and has some thoughts or just wants to try the attached untested patch, I'd appreciate any feedback. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- ? autom4te.cache ? build ? output cvs server: Diffing . Index: configure =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure,v retrieving revision 1.35.2.59 diff -u -r1.35.2.59 configure --- configure 16 Oct 2004 16:20:34 -0000 1.35.2.59 +++ configure 26 Jun 2005 16:59:28 -0000 @@ -9644,6 +9644,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { #if defined (__GLIBC__) @@ -9782,6 +9784,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { @@ -9825,7 +9829,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -9837,7 +9841,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 26 Jun 2005 16:59:28 -0000 @@ -218,6 +218,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { #if defined (__GLIBC__) @@ -356,6 +358,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { @@ -399,7 +403,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -411,7 +415,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" cvs server: Diffing CNI cvs server: Diffing MACOSX_IDE cvs server: Diffing MACOSX_IDE/CW cvs server: Diffing MACOSX_IDE/ForPackageMaker cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions cvs server: Diffing MACOSX_IDE/ForPackageMaker/Resources cvs server: Diffing MACOSX_IDE/PB cvs server: Diffing WinCE cvs server: Diffing contrib cvs server: Diffing debian cvs server: Diffing src Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 26 Jun 2005 16:59:29 -0000 @@ -2079,15 +2079,17 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int BaudBase The clock frequency divided by 16. Default * BaudBase is 115200. * @return boolean true on success - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:setBaudBase()"); @@ -2097,10 +2099,11 @@ /** * Extension to CommAPI * @return int BaudBase - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getBaudBase() throws UnsupportedCommOperationException + public int getBaudBase() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getBaudBase()"); @@ -2108,13 +2111,14 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, IOException { if ( debug ) z.reportln( "RXTXPort:setDivisor()"); @@ -2124,10 +2128,11 @@ /** * Extension to CommAPI * @returns int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getDivisor() throws UnsupportedCommOperationException + public int getDivisor() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getDivisor()"); Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 26 Jun 2005 16:59:30 -0000 @@ -1877,16 +1877,27 @@ int fd = get_java_var( env, jobj,"fd","I" ); struct serial_struct sstruct; + if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) + { + goto fail; + } + + sstruct.baud_base = (int) BaudBase; + if ( sstruct.baud_base < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetBaudBase", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetBaudBase", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1914,9 +1925,13 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) ( sstruct.baud_base ) ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetBaudBase", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetBaudBase", strerror( errno ) ); @@ -1950,19 +1965,23 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } if ( sstruct.custom_divisor < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetDivisor", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetDivisor", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1971,7 +1990,7 @@ accept: none perform: Find the Divisor used for custom speeds - return: Divisor + return: Divisor negative value on error. exceptions: Unsupported Comm Operation on systems not supporting TIOCGSERIAL comments: @@ -1990,10 +2009,14 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) sstruct.custom_divisor ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetDivisor", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetDivisor", strerror( errno ) ); @@ -2032,7 +2055,7 @@ /* Open and lock the port so nothing else changes the setting */ - if ( LOCK( filename, pid ) ) goto fail;; + if ( LOCK( filename, pid ) ) goto fail; fd = find_preopened_ports( filename ); if( !fd ) Index: src/SerialPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/Attic/SerialPort.java,v retrieving revision 1.3.2.9 diff -u -r1.3.2.9 SerialPort.java --- src/SerialPort.java 12 Oct 2004 08:59:28 -0000 1.3.2.9 +++ src/SerialPort.java 26 Jun 2005 16:59:30 -0000 @@ -103,13 +103,17 @@ public abstract String getUARTType() throws UnsupportedCommOperationException; public abstract boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getBaudBase() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getDivisor() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setLowLatency() throws UnsupportedCommOperationException; public abstract boolean getLowLatency() cvs server: Diffing src/lfd cvs server: Diffing src/psmisc From uwe at kubosch.no Mon Jun 27 14:13:57 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Mon, 27 Jun 2005 22:13:57 +0200 Subject: [Rxtx] RXTX on FC4 Message-ID: <1119903238.2989.27.camel@BPC0276> Hi all! I just got RXTX to work on Fedora Core 4. The standard download did not work. I had to check the code out from CVS and build it, but then it worked flawlessly. Thanks for your good work. Now I wonder if I should contribute the compiled files so that others will have an easier time than me getting RXTX to work on FC4. What do I do? Who do I talk to? donV From taj at www.linux.org.uk Mon Jun 27 14:29:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 27 Jun 2005 21:29:46 +0100 (BST) Subject: [Rxtx] RXTX on FC4 In-Reply-To: <1119903238.2989.27.camel@BPC0276> References: <1119903238.2989.27.camel@BPC0276> Message-ID: On Mon, 27 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I just got RXTX to work on Fedora Core 4. > > The standard download did not work. > > I had to check the code out from CVS and build it, but then it worked > flawlessly. > > Thanks for your good work. > > Now I wonder if I should contribute the compiled files so that others > will have an easier time than me getting RXTX to work on FC4. What do I > do? Who do I talk to? > > The best thing to do with FC is to contibute an extras RPM. Debian does something like this with their .deb packaging. As rxtx is OS neutral, it is almost impossible to have everything on rxtx.org. If you do get a package in Fedora Extras, I can point a link there. The extra's mail list is here: https://www.redhat.com/mailman/listinfo/fedora-extras-list If it would help to have me release a 'stable' .tar.gz of the source for the RPM submittal process I can do that. It would also trigger upgrades in debian which would not be bad. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Mon Jun 27 16:23:20 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 27 Jun 2005 17:23:20 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: Message-ID: <42C07C58.1030608@atcorp.com> Hey Trent, I installed it and now I get IOExceptions instead of the other one. I'm not sure how those changes would have enabled setDivisor and setBaudBase to work though. Is it significant that this is a USB device emulating a serial port? ~ Shawn From taj at www.linux.org.uk Mon Jun 27 18:07:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 01:07:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: <42C07C58.1030608@atcorp.com> References: <42C07C58.1030608@atcorp.com> Message-ID: On Mon, 27 Jun 2005, Shawn Lavelle wrote: > Hey Trent, > I installed it and now I get IOExceptions instead of the other one. > I'm not sure how those changes would have enabled setDivisor and > setBaudBase to work though. Is it significant that this is a USB device > emulating a serial port? > The USB driver probably does not support this. With USB, the ioctl()'s appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through the linux drivers/usb tree and found to ioctl to support this in Linux 2.6.10. RXTX is not doing very much magic, the patch really only gets the serial struct instead of writing a structure with random values for baudbase and handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel level driver issue not a user space library issue. So if you wanted this to work, the usb serial driver would have to handle the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression after looking through the USB tree quickly. I hope that helps. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Jun 27 18:25:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 27 Jun 2005 20:25:22 -0400 Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) Message-ID: Hi All, I wrote: Jasmine: Is this working any better? And Jasmine says: Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) I am using -source 1.3 and -target 1.3 for the compilation, however, we still seem to have this problem, which my machine (for some reason) does not have. Does anyone have any ideas about what might be the problem? Thanks! - DL From taj at www.linux.org.uk Mon Jun 27 19:04:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 02:04:37 +0100 (BST) Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) In-Reply-To: References: Message-ID: On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I wrote: > Jasmine: Is this working any better? > > And Jasmine says: > Nope. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > > I am using -source 1.3 and -target 1.3 > for the compilation, however, we still seem to have this problem, > which my machine (for some reason) does not have. > Does anyone have any ideas about what might be the problem? > This has shown up in the past with jdk 1.5 compiled jars running on jre 1.4 machines. My guess is either jasmine has an old copy of rxtx with the problem on her machine that is being picked up on the classpath or you have not tried this with jre 1.4. The suggested -source/target fix should avoid the problem. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Mon Jun 27 21:23:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 04:23:55 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: On Tue, 28 Jun 2005, Trent Jarvi wrote: > On Mon, 27 Jun 2005, Shawn Lavelle wrote: > > > Hey Trent, > > I installed it and now I get IOExceptions instead of the other one. > > I'm not sure how those changes would have enabled setDivisor and > > setBaudBase to work though. Is it significant that this is a USB device > > emulating a serial port? > > > > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > > RXTX is not doing very much magic, the patch really only gets the serial > struct instead of writing a structure with random values for baudbase and > handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel > level driver issue not a user space library issue. > > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. > > I hope that helps. > > > It may be possible that you can just modify translate_speed and get_java_baudrate in SerialImp.c to have the new high speds you are after. The defines are in /usr/include/termios.h. #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 You can see many of these are not handled. I dont think CommAPI handled more than 57600 or so. int get_java_baudrate( int native_speed ) { switch( native_speed ) { case B0: return 0; case B50: return 50; case B75: return 75; case B110: return 110; case B134: return 134; case B150: return 150; case B200: return 200; case B300: return 300; case B600: return 600; case B1200: return 1200; case B1800: return 1800; case B2400: return 2400; case B4800: return 4800; case B9600: return 9600; case B19200: return 19200; case B38400: return 38400; case B57600: return 57600; default: return -1; } } int translate_speed( JNIEnv *env, jint speed ) { LEAVE( "RXTXPort:translate_speed" ); switch( speed ) { case 0: return B0; case 50: return B50; case 75: return B75; case 110: return B110; case 134: return B134; case 150: return B150; case 200: return B200; case 300: return B300; case 600: return B600; case 1200: return B1200; case 1800: return B1800; case 2400: return B2400; case 4800: return B4800; case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; #ifdef B57600 case 57600: return B57600; #endif /* B57600 */ #ifdef B115200 case 115200: return B115200; #endif /* B115200 */ #ifdef B230400 case 230400: return B230400; #endif /* B230400 */ #ifdef B460800 case 460800: return B460800; #endif /* B460800 */ #ifdef B14400 case 14400: return B14400; #endif /* B14400 */ #ifdef B28800 case 28800: return B28800; #endif /* B28800 */ #ifdef B128000 /* dima */ case 128000: return B128000; #endif /* dima */ #ifdef B256000 /* dima */ case 256000: return B256000; #endif /* dima */ } /* Handle custom speeds */ if( speed >= 0 ) return speed; else { LEAVE( "RXTXPort:translate_speed: Error condition" ); return -1; } } -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 28 05:20:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 28 Jun 2005 07:20:21 -0400 Subject: [Rxtx] cross-compilation using Make for Mac Message-ID: Hi All, Please excuse the long post; Trent said: >" >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. " Here is what I have on the mac version: java -version java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) When I run: http://show.docjava.com:8086/book/cgij/code/jnlp/math.benchmarks.Dhry.jnlp I get: -- listing properties -- jnlpx.heapsize=NULL,NULL jnlpx.splashport=-1 java.runtime.name=Java(TM) 2 Runtime Environment, Stand... java.protocol.handler.pkgs=com.sun.javaws.net.protocol sun.boot.library.path=/System/Library/Frameworks/JavaVM.fra... java.vm.version=1.4.2-38 awt.nativeDoubleBuffering=true gopherProxySet=false http.auth.serializeRequests=true java.vm.vendor="Apple Computer, Inc." java.vendor.url=http://apple.com/ path.separator=: java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io jnlpx.home=/Applications/Utilities/Java/Java Web... user.country=US sun.os.patch.level=unknown java.vm.specification.name=Java Virtual Machine Specification user.dir=/ java.runtime.version=1.4.2_05-141.4 java.awt.graphicsenv=apple.awt.CGraphicsEnvironment java.endorsed.dirs=/System/Library/Frameworks/JavaVM.fra... os.arch=ppc java.io.tmpdir=/tmp line.separator= java.vm.specification.vendor=Sun Microsystems Inc. jnlpx.remove=false os.name=Mac OS X sun.java2d.fontpath= java.library.path=/Applications/Utilities/Java/Java Web... java.specification.name=Java Platform API Specification java.class.version=48.0 jnlpx.deployment.user.home=/Users/lyon/Library/Caches/Java Web S... java.util.prefs.PreferencesFactory=java.util.prefs.MacOSXPreferencesFactory os.version=10.3.9 user.home=/Users/lyon user.timezone=America/New_York java.security.policy=file:/Applications/Utilities/Java/Jav... java.awt.printerjob=apple.awt.CPrinterJob trustProxy=true java.specification.version=1.4 file.encoding=MacRoman jnlpx.deployment.system.home=/Applications/Utilities/Java/J2SE 5.0... user.name=lyon java.class.path=/Applications/Utilities/Java/Java Web... java.vm.specification.version=1.0 sun.arch.data.model=32 java.home=/System/Library/Frameworks/JavaVM.fra... java.specification.vendor=Sun Microsystems Inc. user.language=en awt.toolkit=apple.awt.CToolkit java.vm.info=mixed mode java.version=1.4.2_05 java.ext.dirs=/Users/lyon/Library/Java/Extensions:/... sun.boot.class.path=/System/Library/Frameworks/JavaVM.fra... java.vendor=Apple Computer, Inc. file.separator=/ java.vendor.url.bug=http://developer.apple.com/java/ sun.cpu.endian=big sun.io.unicode.encoding=UnicodeBig mrj.version=141.3 jnlpx.jvm=/System/Library/Frameworks/JavaVM.fra... sun.cpu.isalist= sun.awt.exception.handler=apple.awt.CToolkit$EventQueueExceptio... javawebstart.version=javaws-1.4.2_05 800 mhz g4,878k ds/sec total time: 1184ms Result: 844594 dhrystone/sec. Load average for last 15 minutes:0.62 So, I feel pretty sure that I have tried this with 1.4. As to modifying the RXTX compilation, that I did not do...and I take your point. I have been using the binary distributions as is. Oops. I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Now when I do a make, I get: make gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known libtool: link: warning: undefined symbols not allowed in i386-pc-mingw32 shared libraries rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ln: `SerialImp.o': File exists make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 So, I do a make clean, then a make: .... (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ar cru .libs/librxtxSerial.a /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o ar: /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o: No such file or directory make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 In the i386 directory, there is a symbolic link left from something: ls -al SerialImp.o lrwxrwxrwx 1 lyon lyon 12 Jun 28 07:03 SerialImp.o -> SerialImp.lo However, the SerialImp.lo is not present (which is the cause of the error, I think). On the other hand, the file I am looking for is present in: i686-pc-linux-gnu Possibly the i386 generation is not clean (of course it is also likely that I am just asking dumb questions, being a newbie to the code and all.). Finally, will this make file regenerate the distro for the mac? I found some really old (from year 2001) files in: cvs/MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions Which I could use for the distro...but I would prefer to do a clean, multi-platform build from make. Thanks! - Doug >On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > >> Hi All, >> I wrote: >> Jasmine: Is this working any better? >> >> And Jasmine says: >> Nope. >> >> An error occurred while launching/running the application. >> >> Title: addbk.JAddressBook.Main >> Vendor: DocJava, Inc. >> Category: Unexpected Error >> >> gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) >> >> > > I am using -source 1.3 and -target 1.3 >> for the compilation, however, we still seem to have this problem, >> which my machine (for some reason) does not have. >> Does anyone have any ideas about what might be the problem? >> > >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. > > >The suggested -source/target fix should avoid the problem. > >-- >Trent Jarvi >tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 28 09:43:41 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 28 Jun 2005 10:43:41 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: <42C1702D.1070307@atcorp.com> > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. There is ioctl stuff in the driver for the chip, but i haven't seen the TIOC*SERIAL entries. That might be why it continues to fail. I did get around the problem, though, by hacking the driver and just specifying the baud rate I need. Now everything works well. Thanks for all the assistance you've provided. ~ Shawn M. Lavelle From taj at www.linux.org.uk Tue Jun 28 12:42:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:42:29 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known Add a compiler flag -DWIN32 The code above should not be compiling on w32 as it is #if !defined(WIN32) You can look at the bottom of Makefile.in to see the w32 compile flags. Search for "WIN32 CrossCompiling from here down" If its still not working, I can set you up with the Bob account. Just email me off the list. W32 compiling is a bit complicated. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 28 12:52:50 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:52:50 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Nods. I did change configure but right now it is only in the baudbase/divisor patch I posted. I'm going to add several extension baud rates that can be supported by normal API calls and commit that today as a followup to my comments yesterday on baudrates. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Wed Jun 29 01:52:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 08:52:10 +0100 (BST) Subject: [Rxtx] [PATCH] More baud rate fixes Message-ID: I went through the native baudrate conversion from Java and added several. This patch is against CVS 2.1 head. I think thats it for baud rate fixes unless someone see something. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- A non-text attachment was scrubbed... Name: baud_base_and_divisor_plus_odd_baudrates.diff.gz Type: application/x-gzip Size: 3291 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050629/4c1ef1c2/baud_base_and_divisor_plus_odd_baudrates.diff-0001.gz From lyon at docjava.com Wed Jun 29 10:33:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 29 Jun 2005 12:33:45 -0400 Subject: [Rxtx] java.comm dependencies Message-ID: Hi All, During a build of the rxtx code, I have left the javax.comm out of the system (on purpose). However, I get an error, at run time: CommPortIdentifier:static initialization() apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: javax/comm/CommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver I am thinking that there is something in the gnu.io.CommPortIdentifier that seeks to load the javax.comm.CommDriver. It was my understanding that we could write code without reference to the javax.comm.CommDriver and that we could work in the gnu namespace. Is this true? Thanks! - Doug From taj at www.linux.org.uk Wed Jun 29 11:16:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 18:16:08 +0100 (BST) Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > During a build of the rxtx code, I have left the > javax.comm out of the system (on purpose). > However, I get an error, at run time: > > CommPortIdentifier:static initialization() > apple.awt.EventQueueExceptionHandler Caught Throwable : > java.lang.NoClassDefFoundError: javax/comm/CommDriver > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > that seeks to load the javax.comm.CommDriver. > > It was my understanding that we could write code without reference > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > Is this true? > Yes. People use 2.1 without javax all the time. There should be no reference to javax at all in rxtx 2.1. You may check your code. I just did a grep through 2.1 and there is nothing. You may look at the classes you are using. If you find javax.comm in your code, replace it with gnu.io and that should be all you need to do. -- Trent Jarvi tjarvi at qbang.org From jayant28k at gmail.com Wed Jun 29 21:49:28 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Thu, 30 Jun 2005 09:19:28 +0530 Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: <6a6a02310506292049778c452f@mail.gmail.com> Trent, I think best idea is to have wiki for rxtx code. So as the traffic is increasing with time. "RXTX" seems to be more popular in embbeded system. Sun Microsystems will always apperciate your efforts on parallel and serial ports commincation based application in IT Industry. Thanks for your help on this forum as "ONE MAN ARMY" ;-) Cheers, Jayant On 6/29/05, Trent Jarvi wrote: > On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > > > Hi All, > > During a build of the rxtx code, I have left the > > javax.comm out of the system (on purpose). > > However, I get an error, at run time: > > > > CommPortIdentifier:static initialization() > > apple.awt.EventQueueExceptionHandler Caught Throwable : > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > > that seeks to load the javax.comm.CommDriver. > > > > It was my understanding that we could write code without reference > > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > > > Is this true? > > > > Yes. People use 2.1 without javax all the time. > > There should be no reference to javax at all in rxtx 2.1. You may check > your code. I just did a grep through 2.1 and there is nothing. You may > look at the classes you are using. > > If you find javax.comm in your code, replace it with gnu.io and that > should be all you need to do. > > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From uwe at kubosch.no Sat Jun 25 02:50:24 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Sat, 25 Jun 2005 10:50:24 +0200 Subject: [Rxtx] RXTX in FC3/FC4 Message-ID: <1119689424.12606.14.camel@BPC0276> Hi all! I am trying to get RXTX to work on Fedora Core, version 3 or 4. I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext directory. I have edited the jre/lib/javax.comm.properties according to the docs. I have tried this with both rxtx 2.0 and 2.1. I have tried on two different machines. I have tried with java 1.4.2 and java 1.5.0, both from Sun. I always get a signall 11 from the native libraries when they are loaded. Is this a common problem? Any help is greatly appreciated. Below is the start of the error message. More can be supplied on demand. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x65015A Function=(null)+0x65015A Library=/lib/ld-linux.so.2 NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) - locked <0xed46f628> (a java.util.Vector) - locked <0xed471708> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xed46ebc0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.InitializeDriver(CommPortIdentifier.java:213) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:248) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:351) at com.jpeterson.x10.module.CM11A.allocate(CM11A.java:1160) at net.sourceforge.cruisecontrol.publishers.X10Publisher.send(X10Publisher.java:182) at net.sourceforge.cruisecontrol.publishers.X10Publisher.turnOff(X10Publisher.java:171) at net.sourceforge.cruisecontrol.publishers.X10Publisher.handleBuild(X10Publisher.java:148) at net.sourceforge.cruisecontrol.publishers.X10Publisher.publish(X10Publisher.java:141) at net.sourceforge.cruisecontrol.Project.publish(Project.java:679) at net.sourceforge.cruisecontrol.Project.build(Project.java:227) at net.sourceforge.cruisecontrol.Project.execute(Project.java:153) at net.sourceforge.cruisecontrol.ProjectWrapper.run(ProjectWrapper.java:66) at java.lang.Thread.run(Thread.java:534) From chris_jh at blueyonder.co.uk Tue Jun 28 05:37:10 2005 From: chris_jh at blueyonder.co.uk (Christopher Harris) Date: Tue, 28 Jun 2005 12:37:10 +0100 Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError Message-ID: <42C13666.9030108@blueyonder.co.uk> Hi I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 32bit) The serial ports work fine with no issues, but when i try to use the parallel port i get this message Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:66) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) I am trying to print a line out to port "/dev/lp0" At first i thought it could not find the librxtxParallel.so file, but when i renamed it i got a different saying it could not find the library. I have tried to run as root no difference. It is really weird, i get no compile errors and the serial ports work fine. I changed the LPRPort.java and commented out the Initialize call method. And just get the same error but for the method open. It is as though it can't see the methods, and yet it can see the library. I did have a bit of check of the JNI implementation in rxtx but could not spot anything. Yours Thankfully Christopher Harris From lyon at docjava.com Thu Jun 30 02:28:09 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 04:28:09 -0400 Subject: [Rxtx] tools Message-ID: Hi All, I have been thinking about automatic cross-platform native method development of Java/C programs. It appears that different binary tools are needed to target different platforms. Configuration seems a bit painful. Is there something better available than make? Is ANT any good at this? Has anyone tried: http://jnipp.sourceforge.net/ Thanks! - Doug From lyon at docjava.com Thu Jun 30 04:11:17 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 06:11:17 -0400 Subject: [Rxtx] javax.comm Message-ID: Hi All, When I load my jar files on a linux box, all is well. However, when I load them on a mac, I get: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver The jar files for the mac are different from the jar files for linux, because recompilation of the native code for the mac has not been easy, for me. As a result, the RXTX jars are tending toward specific versions and platforms. Probably, this is not an ideal situation, but, I suspect, it is common. I have an idea that we could create a single JNLP distro site that we can make reference to that would enable a uniform repository of synchronized signed native methods and jars for RXTX. For example, the one-wire Maxim folks have a real-nice approach where their stuff makes reference to another JNLP file that contains all the stuff we need to make RXTX work. Check it out at: http://www.maxim-ic.com/products/ibutton/software/1wire/OneWireViewer.cfm However, even they have problems on an unconfigured machine: Specified adapter name "DS9097U" is not known * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cannot load default adapter. Please check that the adapter is connected and that no other application is using the port. If you have checked the adapter, the default port might not be selected. Either set the value of the TMEX default using the utility provided with the TMEX Runtime, or create a new file in the /lib folder called onewireviewer.properties with two lines, similar to the following: #native win32 drivers adapter.name={DS9097U} adapter.port=COM1 #or javax.comm drivers adapter.name=DS9097U adapter.port=COM1 The full path to this file should be: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/onewireviewer.properties ---- Wow, that is a show stopper! Configuration is something that we really need to think about as an automatic thing, particularly for web start users. You can't ask a person who wants to run an application to figure out how to alter a properties file. If you know you need one, then get permission and make one...automatically. That makes a lot of sense, to me. Basically, we need an installer. At the very least, all the pre-built binaries and jars needed for the RXTX package on several platforms should be available from a single place. One this happens, we can make a JNLP file that is platform specific, but can give us a level of indirection. Is this something that has been done already? Thanks! - Doug From taj at www.linux.org.uk Thu Jun 30 08:10:22 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 15:10:22 +0100 (BST) Subject: [Rxtx] tools In-Reply-To: References: Message-ID: On Thu, 30 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I have been thinking about automatic cross-platform > native method development of Java/C programs. > > It appears that different binary tools are needed to target different > platforms. Configuration seems a bit painful. > > Is there something better available than make? > > Is ANT any good at this? I'm far from an Ant expert but have used it for other projects. The main problem I see with ant is there is no mainstream support for platform neutral neutral library creation as far as I can tell. I think ant is a fine replacement for make but I've not seen a suitable replacement for autoconf. At that point, make is as good as anything. It should be possible to create a ant build.xml that works on say Solaris, Linux, Windows and Mac OS X. The problem is when you are trying to build a library for embeded ARM from Mac OS X. > Has anyone tried: > http://jnipp.sourceforge.net/ -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:22:02 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:22:02 +0100 (BST) Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <1119689424.12606.14.camel@BPC0276> References: <1119689424.12606.14.camel@BPC0276> Message-ID: On Sat, 25 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I am trying to get RXTX to work on Fedora Core, version 3 or 4. > > I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 > directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext > directory. > > I have edited the jre/lib/javax.comm.properties according to the docs. > > I have tried this with both rxtx 2.0 and 2.1. > > I have tried on two different machines. > > I have tried with java 1.4.2 and java 1.5.0, both from Sun. > > I always get a signall 11 from the native libraries when they are > loaded. Is this a common problem? Any help is greatly appreciated. > Below is the start of the error message. More can be supplied on > demand. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x65015A > Function=(null)+0x65015A > Library=/lib/ld-linux.so.2 > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) If you compile rxtx from source, this will probably go away. I'm not sure what the exact cause is but it looks like the binaries are not suitable for FC3/4. The ABI may have changed since those had been compiled. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:26:56 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:26:56 +0100 (BST) Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError In-Reply-To: <42C13666.9030108@blueyonder.co.uk> References: <42C13666.9030108@blueyonder.co.uk> Message-ID: tOn Tue, 28 Jun 2005, Christopher Harris wrote: > Hi > > I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 > 32bit) > > The serial ports work fine with no issues, but when i try to use the > parallel port i get this message > > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:66) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) > > > I am trying to print a line out to port "/dev/lp0" > > At first i thought it could not find the librxtxParallel.so file, but > when i renamed it i got a different saying it could not find the library. > > I have tried to run as root no difference. > > It is really weird, i get no compile errors and the serial ports work fine. > > I changed the LPRPort.java and commented out the Initialize call method. > And just get the same error but for the method open. > > It is as though it can't see the methods, and yet it can see the library. > I did have a bit of check of the JNI implementation in rxtx but could > not spot anything. > > > You can check if the symbols are in the shared library: nm librxtxSerial.so |grep Initialize If the symbols are not there, there was a build error. Watch very close for build errors while compiling from source. I suspect something isnt behaving right. -- Trent Jarvi tjarvi at qbang.org From allen at adbyrne.us Thu Jun 30 06:55:58 2005 From: allen at adbyrne.us (Allen Byrne) Date: Thu, 30 Jun 2005 07:55:58 -0500 Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> References: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> Message-ID: <200506300755.59159.allen@adbyrne.us> On Thursday 30 June 2005 00:31, rxtx-request at mail.electronpusher.org wrote: > >Message: 8 >Date: Sat, 25 Jun 2005 10:50:24 +0200 >From: Uwe Kubosch >Subject: [Rxtx] RXTX in FC3/FC4 >To: rxtx at mail.electronpusher.org >Message-ID: <1119689424.12606.14.camel at BPC0276> >Content-Type: text/plain > >Hi all! > >I am trying to get RXTX to work on Fedora Core, version 3 or 4. > >I have tried this with both rxtx 2.0 and 2.1. > >I have tried on two different machines. > >I have tried with java 1.4.2 and java 1.5.0, both from Sun. > >I always get a signall 11 from the native libraries when they are >loaded. ?Is this a common problem? ?Any help is greatly appreciated. >Below is the start of the error message. ?More can be supplied on >demand. > >An unexpected exception has been detected in native code outside the VM. >Unexpected Signal : 11 occurred at PC=0x65015A >Function=(null)+0x65015A >Library=/lib/ld-linux.so.2 > I had thi same problem on SUSE9.3 and java 1.5.0. After searching through the archives, I found a patch that required adding a sleep(1000) command in two functions of SerialIO.java. This only was for rxtx2.1, I had no trouble with rxtx2.0. Note, also I had to add the "|1.5*" sequence to the configure.in file to get good *.so libs. Again 2.0 was fine. -- Allen Byrne adbyrne at ieee.org http://modelrr.adbyrne.us From taj at www.linux.org.uk Fri Jun 3 01:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 08:57:29 +0100 (BST) Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 3 09:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 16:57:53 +0100 (BST) Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi at qbang.org From jasmine at electronpusher.org Fri Jun 3 10:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 17:12:21 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 11:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:02:09 +0100 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 11:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:05:10 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From jon.nall at gmail.com Mon Jun 6 09:13:58 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 10:13:58 -0500 Subject: [Rxtx] StackOverflowError Message-ID: I have a fairly small application that is communicating to a microcontroller programmer at 115.2k. I have a test where I try and dump the memory of the microcontroller (whose size is 8k and change). Things are going smoothly and the data looks good. Then after reading out ~6.5k of data, I get a StackOverflowError. The stack trace looks like: CommInterface.serialEvent(): 324 // this is my code RXTXPort.sendEvent(): 732 RXTXPort.eventLoop() [Native] MonitorThread.run(): 1531 I am running on windows and using rxtx-2.1-CVS-20050120. When I increased the stack size to 512k, I could read the entire chip without issue. But that doesn't seem like the right thing to do without root causing what's happening. My code doesn't include any recursion and the stack trace looks terribly short, so I'm a bit confused as to why I'm getting a StackOverflowError. CommInterface.serialEvent() does little more than grab the available bytes, enter a synchronized block, stick them in a common data area for the main thread to use and leave the synchronization block. I guess my question is: are there any known issues with the default stack size when using the latest rxtx on windows? thanks, nall. From taj at www.linux.org.uk Mon Jun 6 09:27:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 16:27:34 +0100 (BST) Subject: [Rxtx] StackOverflowError In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > I have a fairly small application that is communicating to a > microcontroller programmer at 115.2k. I have a test where I try and > dump the memory of the microcontroller (whose size is 8k and change). > Things are going smoothly and the data looks good. Then after reading > out ~6.5k of data, I get a StackOverflowError. The stack trace looks > like: > > CommInterface.serialEvent(): 324 // this is my code > RXTXPort.sendEvent(): 732 > RXTXPort.eventLoop() [Native] > MonitorThread.run(): 1531 > > I am running on windows and using rxtx-2.1-CVS-20050120. When I > increased the stack size to 512k, I could read the entire chip without > issue. But that doesn't seem like the right thing to do without root > causing what's happening. My code doesn't include any recursion and > the stack trace looks terribly short, so I'm a bit confused as to why > I'm getting a StackOverflowError. > > CommInterface.serialEvent() does little more than grab the available > bytes, enter a synchronized block, stick them in a common data area > for the main thread to use and leave the synchronization block. > > I guess my question is: are there any known issues with the default > stack size when using the latest rxtx on windows? > This is the first I've heard of the problem. It is strange as you mention lookin at the stack trace. That cant be taking up too much space. If you just toss the data instead of trying to put it in your work area, does it persist? -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Mon Jun 6 10:09:39 2005 From: lengyel at gmail.com (FL) Date: Mon, 6 Jun 2005 12:09:39 -0400 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on which the jdk1.5.0_03 is installed. I found that the INSTALL documentation seems to be in error. It states that javacomm20-x86.tar.Z (the Java Communications API for Solaris/x86) must be used, in fact this choice led to the following test with theBlackBox sample program in the commapi: root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG BlackBox -p /dev/ttyS0 Port /dev/ttyS0 not found! No serial ports found! Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to cause Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to the Eclipse stable build version 3.1M7 to avoid this. However, I found that using the Solaris/Sparc version of commapi worked on my system. I have documented this on: http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050606/b28fb9a7/attachment-0002.html From taj at www.linux.org.uk Mon Jun 6 10:30:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:30:27 +0100 (BST) Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, FL wrote: > I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on > which the jdk1.5.0_03 is installed. I found that the INSTALL documentation > seems to be in error. It states that javacomm20-x86.tar.Z (the Java > Communications API for Solaris/x86) must be used, in fact this choice led to > the following test with theBlackBox sample program in the commapi: > > root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG > BlackBox -p /dev/ttyS0 > Port /dev/ttyS0 not found! > No serial ports found! > > Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to > cause > Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to > the Eclipse stable build version 3.1M7 to avoid this. > > However, I found that using the Solaris/Sparc version of commapi > worked on my system. > > I have documented this on: > > http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 > Thanks FL. I'll change the documentation to point to the SPARC comm.jar. In the past, any Solaris was good enough, we tried to avoid the w32 comm.jar because it made native calls rxtx would never implement on any OS as they are not platform neutral. I'll withold comments about Sun's comm.jar being different on various CPUs within even the same OS. RXTX 2.1 does not need to do that even acrossed OSs for instance. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 6 10:35:43 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 11:35:43 -0500 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API Message-ID: It seems that Sun's javax.comm site does not include JavaDoc'ed API and the RxTx site has the API, but no real documentation. Is there some site that i'm just missing in my google searches? I'm looking for a copy of the javax.comm API which is documented. Thanks, nall. From taj at www.linux.org.uk Mon Jun 6 10:44:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:44:03 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > It seems that Sun's javax.comm site does not include JavaDoc'ed API > and the RxTx site has the API, but no real documentation. Is there > some site that i'm just missing in my google searches? I'm looking for > a copy of the javax.comm API which is documented. > > Thanks, > nall. Sun's version is with their binary downloads. RXTX tries to match that so I never bothered with more complete JavaDocs. Whatever Sun documents is what we try to do. -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Mon Jun 6 12:13:44 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 6 Jun 2005 14:13:44 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: Message-ID: <20050606181245.528C929D56F@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Trent Jarvi > Sent: Monday, June 06, 2005 12:44 PM > To: Jon Nall; Java RXTX discussion > Subject: Re: [Rxtx] Where can I find JavaDoc on the javax.comm API > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > It seems that Sun's javax.comm site does not include JavaDoc'ed API > > and the RxTx site has the API, but no real documentation. Is there > > some site that i'm just missing in my google searches? I'm > looking for > > a copy of the javax.comm API which is documented. > > > > Thanks, > > nall. > > Sun's version is with their binary downloads. RXTX tries to > match that so I never bothered with more complete JavaDocs. > Whatever Sun documents is what we try to do. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Try http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht ml -Ack From gadelavega at yahoo.com.ar Mon Jun 6 12:58:09 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Mon, 6 Jun 2005 15:58:09 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606181245.528C929D56F@mail.electronpusher.org> Message-ID: <20050606185809.57069.qmail@web14603.mail.yahoo.com> --- "David S. Acker" escribi?: > > -----Original Message----- > > From: rxtx-bounces at mail.electronpusher.org > > [mailto:rxtx-bounces at mail.electronpusher.org] On > Behalf Of Trent Jarvi > > Sent: Monday, June 06, 2005 12:44 PM > > To: Jon Nall; Java RXTX discussion > > Subject: Re: [Rxtx] Where can I find JavaDoc on > the javax.comm API > > > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > > > It seems that Sun's javax.comm site does not > include JavaDoc'ed API > > > and the RxTx site has the API, but no real > documentation. Is there > > > some site that i'm just missing in my google > searches? I'm > > looking for > > > a copy of the javax.comm API which is > documented. > > > > > > Thanks, > > > nall. > > > > Sun's version is with their binary downloads. > RXTX tries to > > match that so I never bothered with more complete > JavaDocs. > > Whatever Sun documents is what we try to do. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > Try > http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > ml > -Ack > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > I'm prety sure it was there... but not anymore. Gonzalo A. de la Vega, BI ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From taj at www.linux.org.uk Mon Jun 6 18:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 01:09:14 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606185809.57069.qmail@web14603.mail.yahoo.com> References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: >> http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > > I'm prety sure it was there... but not anymore. > It is there. Maybe the URL got mangled. Try this http://tinyurl.com/8dfp7 It just redirects you to: http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.html -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 7 05:46:39 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Jun 2005 07:46:39 -0400 Subject: [Rxtx] rxtx under fedora - odd procedures Message-ID: Hi All, I was able to get RXTX communications to work under Fedora, but only after I added myself to the UUCP and LOCK groups, logged out and then logged back in. Both groups appear to be needed in order to access the serial ports. Also the group alter did not take until after I logged out and logged back in. My theory is that you need permission to write to the var/spool directory under fedora and that this is the only way to do it. Logging out and logging back in just seems like an odd thing to do. I suppose some users may have to restart X. Ouch! Is this true? The alter_group command indicates that you need to be an su to alter the group database. Does this mean that my serial port users need a database su able person to use serial port applications under RXTX? If so, what is the procedure to make a transparent install work using Java web start? Should I be prompting users for the su password? Should I be telling users to exit from X and log out? Is this the way other serial communications programs work? Thanks! - Doug From sean_montgomery at baseview.com Tue Jun 7 08:14:51 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 7 Jun 2005 10:14:51 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: >>> http://java.sun.com/products/javacomm/javadocs/javax/comm/package- >>> summary.ht >>> > > >> >> I'm prety sure it was there... but not anymore. >> >> > > It is there. Maybe the URL got mangled. Try this > > http://tinyurl.com/8dfp7 > > It just redirects you to: > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > summary.html > Maybe the issue here is that the info is available without frames from that URL, but when you try to access it with frames (from the link on that page) it doesn't work - it takes you to: http://java.sun.com/products/javacomm/javadocs/index.html Which doesn't have anything useful on it. From gadelavega at yahoo.com.ar Tue Jun 7 08:22:50 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:22:50 -0300 (ART) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: Message-ID: <20050607142251.92850.qmail@web14626.mail.yahoo.com> --- "Dr. Douglas Lyon" escribi?: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the > group > alter did not take until after I logged out and > logged back in. > > My theory is that you need permission to write to > the var/spool > directory under fedora and that this is the only way > to do it. > > Logging out and logging back in just seems like an > odd thing to > do. I suppose some users may have to restart X. > Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port > applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log > out? > Is this the way other serial communications programs > work? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Actually, you need the lock group to acces /var/lock directory, and uucp to acces /dev/ttyS*. You (as root) shuold add all users you will allow to use the serial ports to group uucp and all the ones you'll allow to lock the ports to lock group (rxtx needs both). This is not only for rxtx, but for any use of the serial ports. Next time they login they'll be able to work, so if they are in they'll have to log out first. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From gadelavega at yahoo.com.ar Tue Jun 7 08:23:56 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:23:56 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> Message-ID: <20050607142356.93815.qmail@web14624.mail.yahoo.com> --- Sean Montgomery escribi?: > > On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: > > >>> > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > >>> summary.ht > >>> > > > > > >> > >> I'm prety sure it was there... but not anymore. > >> > >> > > > > It is there. Maybe the URL got mangled. Try this > > > > http://tinyurl.com/8dfp7 > > > > It just redirects you to: > > > > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > > summary.html > > > > Maybe the issue here is that the info is available > without frames > from that URL, but when you try to access it with > frames (from the > link on that page) it doesn't work - it takes you > to: > > http://java.sun.com/products/javacomm/javadocs/index.html > > Which doesn't have anything useful on it. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > That's right, my bad. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From jon.nall at gmail.com Tue Jun 7 08:33:40 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 09:33:40 -0500 Subject: [Rxtx] performance expectations Message-ID: Hi all. I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC microcontroller. The protocol I'm using (which I didn't create) looks like this for the section of code I'm concerned with: PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data PIC -> PC: 0x01 // ACK 0xNN // First 8 bits of data 0xMM // Second 8 bits of data I issue ~2000 of these Read commands. The PIC itself has an input fifo which can store 18 bytes, so I can have 18 read commands in flight at a given time. The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k 8N1. I am measuring the time it takes to perform these 2000 commands at around 30 seconds, which is much longer than I anticipated. With the link fully utilized, I expected: Time per byte transmitted: 115200 / 8 = 14400 bytes/second = ~70 uS/byte Time per response transmitted: ~70 uS/byte * 3 bytes/response = ~210 uS/response Time for 2000 responses to be transmitted: ~210 uS/response * 2000 responses = ~420ms I'm a bit new to this, so I may have made some bad asumptions, but I would have expected a time of a couple of seconds to perform the 2000 reads, not 30+ seconds. I'm obviously missing something here. Can someone help me understand what's going on? Thanks, nall. From taj at www.linux.org.uk Tue Jun 7 09:17:48 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:17:48 +0100 (BST) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the group > alter did not take until after I logged out and logged back in. > > My theory is that you need permission to write to the var/spool > directory under fedora and that this is the only way to do it. > > Logging out and logging back in just seems like an odd thing to > do. I suppose some users may have to restart X. Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log out? > Is this the way other serial communications programs work? > RIght now, rxtx requires you do one of two things. 1) Use lock files (recommended). This requires intervention by the root users to allow users to create lock files and open the ports as you note. 2) configure rxtx with --disable-lockfiles. In this case you need only worry about the permissions on /dev/ttyS* I'm not sure what the default on Fedora is with respect to permisions. This is not very attractive. There is a better way it could be done on Fedora. Fedora comes with lockdev library. I've been considering this for some time. We could use that for the locking and do away with many of the problems. The problem is embeded devices running Linux do not come with liblockdev. But for your use, I would consider adding a new option for locking serial devices using liblockdev. lockdev-devel has a man page with further information. SYNOPSIS #include pid_t dev_testlock( const char * devname); pid_t dev_lock( const char * devname); pid_t dev_relock( const char * devname, pid_t pid); pid_t dev_unlock( const char * devname, pid_t pid); cc [ flag ... ] file ... -llockdev [ library ] This would probably need to be a configure time option to prevent problems on embeded Linux devices but could otherwise be the default on Linux. I could toss a quick patch together if this is confusing. It is actually easier than what rxtx does now. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 09:27:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:27:11 +0100 (BST) Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > Hi all. > I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC > microcontroller. The protocol I'm using (which I didn't create) looks like this > for the section of code I'm concerned with: > > PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data > PIC -> PC: 0x01 // ACK > 0xNN // First 8 bits of data > 0xMM // Second 8 bits of data > > I issue ~2000 of these Read commands. The PIC itself has an input fifo which > can store 18 bytes, so I can have 18 read commands in flight at a given time. > The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k > 8N1. > > I am measuring the time it takes to perform these 2000 commands at around 30 > seconds, which is much longer than I anticipated. With the link fully utilized, > I expected: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte > > Time per response transmitted: > ~70 uS/byte * 3 bytes/response = ~210 uS/response > > Time for 2000 responses to be transmitted: > ~210 uS/response * 2000 responses = ~420ms > > I'm a bit new to this, so I may have made some bad asumptions, but I would have > expected a time of a couple of seconds to perform the 2000 reads, not 30+ > seconds. > > I'm obviously missing something here. Can someone help me understand what's > going on? > I've hooked rxtx in loopback with a scope in the past at 9600 baud (baud rate is not important). Using event notification and just writing a byte on event/read the latencey was around 8-12 ms. The JNI is not an efficient way to use native code - especially for bit banging. So if timing is critical you want to move some of the logic into the native code rather than banging over the JNI. 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your performance. C# has advantages here. If you move your logic into the native layer or use gcj (rxtx will work with that too) most of your latency should vanish. You may have to play with some sleeps in eventLoop at that point to get full native efficiency. With gcj all of rxtx becomes 'native code' as java is just treated as a subset of C++. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 09:38:51 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 10:38:51 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: On 6/7/05, Jon Nall wrote: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte of course that should be divided by 10 to account for the start/stop bits, but it barely changes the end results. From carobizar at free.fr Tue Jun 7 10:21:29 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 7 Jun 2005 18:21:29 +0200 Subject: [Rxtx] (no subject) Message-ID: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Hello ! I am a french student and I have to create an application able to read and write on serial and parallel port and to run on Windows and Linux. For the moment my program run on Windows thanks the Java Communication API (version for Microsoft Windows and Solaris/x86). But it doesn't work on Linux. Does a recent version of an installation documentation exist ? I didn't find one on the RXTX site (nothing for the windows installation and the linux installation deals with a "jcl.jar" that I don't know...). So, I have some questions : 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 version or Linux&w32 version ?) What are the differences between them ? Which of them are the most stable ? 2) Where have I to put the .so and .dll files ? 3) What have I to write on the file javax.comm.properties ? 4) Have I to delete the file win32comm.dll included in the Java Comm API ? 5) Have I to keep both comm.jar and RXTXcomm.jar ? Best regards, Caroline. From debief at telemsa.com Tue Jun 7 10:44:56 2005 From: debief at telemsa.com (DEBIEF Eric) Date: Tue, 7 Jun 2005 18:44:56 +0200 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: <200506071844.56656.debief@telemsa.com> Hi, We are "pushing" RxTx /Java here in a half-duplex link. The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC and application handling) about 25?s/byte. The figures are the barely the same on two environments. Environment 1 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Linux 2.6.3, Mdk 10.0. RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : bytes are lost on the wire. I need to investigate this mystery.... Java : 1.4.2-rc1 Blackdown Environment 2 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Windows 2000 Pro RxTx : 2.0.7. Java : 1.4.2_08 SUN I Hope this help, Eric. _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 7 11:05:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:05:45 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, DEBIEF Eric wrote: > Hi, > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. How many write() calls is this? > > Environment 1 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Linux 2.6.3, Mdk 10.0. > RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : > bytes are lost on the wire. I need to investigate this mystery.... > Java : 1.4.2-rc1 Blackdown > > Environment 2 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Windows 2000 Pro > RxTx : 2.0.7. > Java : 1.4.2_08 SUN > In my event/read/write test I found windows was ~20% faster than linux for some reason (strange part is Windows was in VMWare on the same Linux machine). It was about the same rxtx version. There are many problems with rxtx 1.4 with respect to commapi on windows but its code paths are more simple. What some people want from rxtx is perhaps better served by hacking up the very first release as they just want to read and write which is what rxtx was before Sun released commapi. It sounds like perhaps you are pushing out larger writes which will greatly improve results. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 11:16:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:16:49 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118161289.42a5c989cf6a2@imp4-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: On Tue, 7 Jun 2005 carobizar at free.fr wrote: > > Hello ! > > I am a french student and I have to create an application able to read and write > on serial and parallel port and to run on Windows and Linux. > For the moment my program run on Windows thanks the Java Communication API > (version for Microsoft Windows and Solaris/x86). > But it doesn't work on Linux. > > Does a recent version of an installation documentation exist ? > I didn't find one on the RXTX site (nothing for the windows installation and the > linux installation deals with a "jcl.jar" that I don't know...). > > So, I have some questions : > > 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 > version or Linux&w32 version ?) What are the differences between them ? Which > of them are the most stable ? > Use rxtx 2.0 with commapi for sparc solaris from Sun. If you want your current package javax.comm. > 2) Where have I to put the .so and .dll files ? On Linux just use the source, the configure script will do all of that for you. tar -xzvf rxtx-2.0-version mkdir rxtx-2.0-version/build cd rxtx-2.0-version/build ../configure && make install It will do everything for you. With Windows, you need to create the javax.comm.properties and install the DLL on your path. But you can just use Sun's package too. They are intended to be interchangable. > > 3) What have I to write on the file javax.comm.properties ? Driver=gnu.io.RXTXCommDriver More documentation in INSTALL that comes with the source. Sun's documentation should work too. configure does this for you on Linux. > > 4) Have I to delete the file win32comm.dll included in the Java Comm API ? > No > 5) Have I to keep both comm.jar and RXTXcomm.jar ? > Yes. RXTX 2.1 replaces comm.jar but the package is different (gnu.io) to avoid contaminating Sun's namespace. With rxtx 2.0 you need Sun's comm.jar - they work together. > > Best regards, > Caroline. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Tue Jun 7 12:07:34 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 14:07:34 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 Message-ID: <20050607180632.1543A29D5C8@mail.electronpusher.org> Hello, I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our product includes a built in USB to Serial adapter so that when it is connected to your PC over USB, it appears as a serial port. We had problems with Sun's comm library because it did not detect serial ports coming and going properly. I did run into a few issues with RxTx though. I am building under Windows (we support XP and 2000) under cygwin. I used a simple make file for the c code that works under cygwin and ant to build the java stuff. Attached is a diff file. The patches hit the following issues: ParallelImp.c - I am not using config so there is no config.h for me. Also, gcc didn't like a local file (win32termios.h) getting included with <> . RXTXPort.java - You can get an exception during the writeByte, writeArray, nativeDrain, readByte, read, readArray, readTerminatedArray, and nativeAvailable calls. Without this patch the IOLocked count gets stuck incremented. termios.c - If you try to open a port through CreateFile and get ERROR_ACCESS_DENIED it means someone else is using the port. We need to make sure to use serial_close instead of just close. I found that some devices finish their I/O synchronously. The code was treating this as an error. I also added some checking on the ClearError calls. I found a compile error when debugging is turned on (see the usleep change). SerialImp.c - Again, I don't have a config.h and again we must use quotes and not <> to include win32termios.h . I also commented out a report call since it seems to happen constantly on my system. Feel free to use these in any way that you want or just to ignore them. Thanks! -Dave Acker dacker at nomadio.net Software Engineer Nomadio, Inc. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diffs.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/5671d159/diffs-0002.txt From jon.nall at gmail.com Tue Jun 7 12:28:16 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 13:28:16 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, DEBIEF Eric wrote: > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. Hi. This is helpful, thanks. I can think of 2 reasons I'm not collecting the data as fast as I think I should be: 1) the device to PC connection is not at 100% utilization 2) my SerialPortEventListener processing has too much overhead Are there other explanations I might be missing as to why it takes so long to transfer the data? Thanks. nall. From taj at www.linux.org.uk Tue Jun 7 13:21:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:21:46 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > On 6/7/05, DEBIEF Eric wrote: > > We are "pushing" RxTx /Java here in a half-duplex link. > > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > > and application handling) about 25?s/byte. > > The figures are the barely the same on two environments. > > Hi. > This is helpful, thanks. I can think of 2 reasons I'm not collecting > the data as fast as I think I should be: > 1) the device to PC connection is not at 100% utilization > 2) my SerialPortEventListener processing has too much overhead > > Are there other explanations I might be missing as to why it takes so > long to transfer the data? > Polling the port would probably make more sense. You can set the threshold/timeouts to avoid racing and not deal with the event notification. As mentioned earlier I think the event latency is ~10ms. Keep the event listener around, rxtx 2.* does not close well without it. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 13:27:27 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 14:27:27 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, Trent Jarvi wrote: > Polling the port would probably make more sense. You can set the > threshold/timeouts to avoid racing and not deal with the event > notification. As mentioned earlier I think the event latency is ~10ms. Trent, Thanks for the response. Just to make sure I understand what you're talking about, when you say event latency, do you mean the time it takes from when the byte hits the PC's comm port to when rxtx presents it to user code? So if the link is 100% utilized, will my user code see "hiccups" or a steady stream of data? Thanks for helping a serial port newbie. nall. From dacker at nomadio.net Tue Jun 7 13:32:20 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 15:32:20 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <20050607193118.5499329CAA0@mail.electronpusher.org> Some folks asked about the make file and ant steps. I have JAVA_HOME set as follows: $ echo $JAVA_HOME C:\Program Files\Java\jdk1.5.0_01 I have all the code in rxtx/src put into gnu/io . The make file here doesn't have optimizations turned on. We have not tested with it yet. --------------Begin Makefile------------------ CPPFLAGS="-I$(JAVA_HOME)/include" "-I$(JAVA_HOME)/include/win32" SOBJECTS=SerialImp.o fuserImp.o termios.o fixup.o init.o POBJECTS=ParallelImp.o termios.o init.o DLLS=rxtxParallel.dll rxtxSerial.dll all: $(CLASSES) $(DLLS) rxtxSerial.dll: $(SOBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(SOBJECTS) rxtxParallel.dll: $(POBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(POBJECTS) clean: rm -fv $(SOBJECTS) $(POBJECTS) $(DLLS) %.o: %.c gcc -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< %.o: %.cpp g++ -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< --------------End Makefile------------------ Here is the ant target I use to build the rxtx libs. Our build puts the class files in a bin dir. We copy the dlls to a deploy dir and to the build dir. Eclipse seems to like the dlls in the build dir. The deploy dir is used when we build our full package. --------------Begin Ant Section------------------ --------------End Ant Section------------------ > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > David S. Acker > Sent: Tuesday, June 07, 2005 2:08 PM > To: 'Java RXTX discussion' > Subject: [Rxtx] Patches to 2.1-7pre17 > > Hello, > I am using RxTx with the Nomadio Sensor, > http://www.nomadio.net/ . Our product includes a built in > USB to Serial adapter so that when it is connected to your PC > over USB, it appears as a serial port. We had problems with > Sun's comm library because it did not detect serial ports > coming and going properly. > > I did run into a few issues with RxTx though. I am building > under Windows (we support XP and 2000) under cygwin. I used > a simple make file for the c code that works under cygwin and > ant to build the java stuff. Attached is a diff file. The > patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h > for me. Also, gcc didn't like a local file (win32termios.h) > getting included with <> . > > RXTXPort.java - You can get an exception during the > writeByte, writeArray, nativeDrain, readByte, read, > readArray, readTerminatedArray, and nativeAvailable calls. > Without this patch the IOLocked count gets stuck incremented. > > termios.c - If you try to open a port through CreateFile and > get ERROR_ACCESS_DENIED it means someone else is using the > port. We need to make sure to use serial_close instead of > just close. I found that some devices finish their I/O > synchronously. The code was treating this as an error. I > also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we > must use quotes and not <> to include win32termios.h . I > also commented out a report call since it seems to happen > constantly on my system. > > Feel free to use these in any way that you want or just to > ignore them. > Thanks! > > -Dave Acker > dacker at nomadio.net > Software Engineer > Nomadio, Inc. > From taj at www.linux.org.uk Tue Jun 7 13:37:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:37:45 +0100 (BST) Subject: [Rxtx] Re: Stack Smashing Attack In-Reply-To: <200506072012.48860.ferdinand.tatzig@web.de> References: <200506072012.48860.ferdinand.tatzig@web.de> Message-ID: On Tue, 7 Jun 2005, Ferdinand Tatzig wrote: > Dear Trent > > I am using RXTX for serial port communication between a PC and a payment > transaction terminal. > When I run my application under Windows 2000, an i386-Linux or an i386-FreeBSD > it works as I expect it to do. However, when I start it to run on AMD64 > machine with a 64-bit Gentoo Linux, the VM terminates with the following > error: > > Port found: /dev/ttyS0 > java: stack smashing attack in function configure_port() > > I am using a 64-bit Blackdown-1.4.2-01 VM. > > I have searched the internet but have found no information about this error. > > This is the code of the method which initializes the serial port: > > /** > * initializes a serial port for communication with a terminal; only > * accessible within this class > * > * @param communication > * @param serialPortToBeInitialized > * @param tillInterfaceEventListener > */ > private TillInterfaceSerialPort(Communication communication, > String serialPortToBeInitialized, > TillInterfaceEventListener tillInterfaceEventListener) > throws IOException, PortInUseException, > TillInterfaceSerialPortNotFoundException, > TooManyListenersException, UnsupportedCommOperationException { > serialPortName = "not initialized yet"; > CommPortIdentifier portId = null; > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > boolean portFound = false; > String temporarySerialPortName = "not initialized yet"; > > // look for a serial port > while (portList.hasMoreElements() && !portFound) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > temporarySerialPortName = portId.getName(); > if (temporarySerialPortName.equals(serialPortToBeInitialized)) { > System.out.print("Port found: "); > System.out.println(temporarySerialPortName); > serialPortName = temporarySerialPortName; > portFound = true; > } > } > } > if (portFound) { > > // initialize the found port - this command causes the VM to terminate > serialPort = (SerialPort) portId > .open( > TillInterfaceConstants.APPLICATION_NAME, > TillInterfaceConstants > .TIMEOUT_IN_MILLISECONDS_FOR_OPENING_OF_COMMUNICATION_PORT); > > // add an event listener which listens > // on the serial port and notifies the > // serial port object when input bytes > // have been received at the port > serialPort.addEventListener(tillInterfaceEventListener); > serialPort.notifyOnDataAvailable(true); > > // initialize the physical layer > // parameters of the serial port > serialPort.setSerialPortParams(TillInterfaceConstants.BAUD_RATE, > SerialPort.DATABITS_8, SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > // set the inter-character > // timeout (T2) > serialPort > .enableReceiveTimeout(TillInterfaceConstants.INTERCHARACTER_TIMEOUT_IN_MILLISECONDS); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > } else > throw new TillInterfaceSerialPortNotFoundException(); > } > > Any hint to solve this problem would be kindly appreciated. > The only thing that comes to mind here after looking at the offending function is rxtx used to include asm/termios.h but now we moved to termios.h and had glibc fix their headers. The asm/termios.h caused problems as its termios was smaller than the actual termios. This should be fixed in current rxtx versions but you can just glance at SerialImp.c and make sure it does not include asm/termios.h. I've cc'd the rxtx mail list because there was one other mention of stack problems recently. I have used rxtx on opteron systems with success. I have a bug I'm trying hard to reproduce on suse 64 bit (circa linux 2.4.19) systems though. So far I have not been able to reproduce the bug. That said, with gentoo... I like gentoo but I seriously doubt they do any QA with their kernel and Java. I've seen problems before. If you use gentoo and have Java problems, at least stick to Linus (that is an s there) kernels while using Java. I'm not an expert on gentoo but I've seen patches go into experimental kernels that turn out to break java and are reverted before going to Linus just before I see problems with gentoo on this list. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:16:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:16:14 +0100 (BST) Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: On Tue, 7 Jun 2005, David S. Acker wrote: > Hello, > I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our > product includes a built in USB to Serial adapter so that when it is > connected to your PC over USB, it appears as a serial port. We had problems > with Sun's comm library because it did not detect serial ports coming and > going properly. > > I did run into a few issues with RxTx though. I am building under Windows > (we support XP and 2000) under cygwin. I used a simple make file for the c > code that works under cygwin and ant to build the java stuff. Attached is a > diff file. The patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h for me. Also, > gcc didn't like a local file (win32termios.h) getting included with <> . > > RXTXPort.java - You can get an exception during the writeByte, writeArray, > nativeDrain, readByte, read, readArray, readTerminatedArray, and > nativeAvailable calls. Without this patch the IOLocked count gets stuck > incremented. > > termios.c - If you try to open a port through CreateFile and get > ERROR_ACCESS_DENIED it means someone else is using the port. We need to > make sure to use serial_close instead of just close. I found that some > devices finish their I/O synchronously. The code was treating this as an > error. I also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we must use quotes > and not <> to include win32termios.h . I also commented out a report call > since it seems to happen constantly on my system. > > Feel free to use these in any way that you want or just to ignore them. > Thanks! > Hi Dave These patches look great as is. Thanks. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:33:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:33:16 +0100 (BST) Subject: [Rxtx] Patch to IOLocked (fwd) Message-ID: This appears to be another solution to the locking. Chris, the other option just moves the locking into the finally clause which I think would be a little cleaner though I'm posting this patch to so people can comment. -- Trent Jarvi tjarvi at qbang.org ---------- Forwarded message ---------- Date: Wed, 1 Jun 2005 13:01:32 +0100 From: Christopher Dawes To: taj at www.linux.org.uk Subject: Patch to IOLocked Do you want me to check it out of CVS and then submit changes? Christopher -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXPort.java.diff Type: application/octet-stream Size: 6965 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/c442f9fc/RXTXPort.java-0002.obj From Christopher.Dawes at retail-logic.com Wed Jun 8 00:57:24 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 8 Jun 2005 07:57:24 +0100 Subject: [Rxtx] Patch to IOLocked (fwd) [Virus Checked] In-Reply-To: Message-ID: Agreed, much better Java :-) Thanks Christopher ------------------------------------------- Consultant Engineer Retail Logic Limited Fleet GU51 3TZ Tel: +44 (0)1252 644377 Mob: +44 (0)7899 842759 Fax: +44 (0)1252 776708 rxtx-bounces at mail.electronpusher.org wrote on 07/06/2005 21:33:16: > > This appears to be another solution to the locking. Chris, the other > option just moves the locking into the finally clause which I think would > be a little cleaner though I'm posting this patch to so people can > comment. > > -- > Trent Jarvi > tjarvi at qbang.org > > ---------- Forwarded message ---------- > Date: Wed, 1 Jun 2005 13:01:32 +0100 > From: Christopher Dawes > To: taj at www.linux.org.uk > Subject: Patch to IOLocked > > Do you want me to check it out of CVS and then submit changes? > > Christopher[attachment "RXTXPort.java.diff" deleted by Chris > Dawes/Retaillogic/NISABA] _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx From zempftman at gmail.com Wed Jun 8 07:57:25 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 09:57:25 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Maxwell Zempftman Date: May 27, 2005 5:01 PM Subject: Re: [Rxtx] Kaffe & rxtx & armv5b To: rxtx at mail.linuxgrrls.org Here are the results from working this week: The "NullPointerExceptions" are generated by the software when I choose a bad device file. I discovered that this occurs on the i686-RedHat box as well. This exception seems to be generated only by this particular application, and not by the example programs in contrib. So, for example: java MyApp /dev/null <-- generates NullPointerException java MyApp fake <-- generates NullPointerException java MyApp /dev/ttyS0 <-- does not generate NullPointerException Using the program CommCheck (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it appears as though /dev/ttyS0 is the only valid serial device file on the XScale device, so the errors I was getting are not really be bugs. Although /dev/ttyS0 did not generate NullPointerExceptions, I did encounter this error: --start java MyApp /dev/ttyS0 (going mostly from memory, not exact) PortList.hasMoreElements: true Listening on: /dev/ttyS0 Client connected. >From net: echo kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 vmExcept_setJNIFrame Assert: on 'fp != 0' failed. --end I took a look at exception.h, and it seems as though the problematic code does not exist in newer versions of Kaffe (I have been using CVS-2004-11). Next week I will try to use a newer version, although so far everything but CVS-2004-11 has failed. Also, I the device files I need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with something like this? Thanks, Max. > On 5/21/05, Trent Jarvi wrote: > > I'm not sure what is wrong in the first part. It sounds like your > > application may be swallowing an exception while trying to enumerate the > > port or open it. The usual mistake made it not having permissions to > > either open the port or create the lockfile. There should be examples in > > the contrib directory you can try that enumerate and open ports. Maybe > > that will give you some hints. > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > Sun's code limiting you there though you do need to compile and install > > rxtx for the XScale with Sun's Commapi. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > From taj at www.linux.org.uk Wed Jun 8 08:22:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 15:22:44 +0100 (BST) Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > ---------- Forwarded message ---------- > From: Maxwell Zempftman > Date: May 27, 2005 5:01 PM > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > To: rxtx at mail.linuxgrrls.org > > > Here are the results from working this week: > > The "NullPointerExceptions" are generated by the software when I > choose a bad device file. I discovered that this occurs on the > i686-RedHat box as well. This exception seems to be generated only by > this particular application, and not by the example programs in > contrib. So, for example: > > java MyApp /dev/null <-- generates NullPointerException > java MyApp fake <-- generates NullPointerException > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > Using the program CommCheck > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > appears as though /dev/ttyS0 is the only valid serial device file on > the XScale device, so the errors I was getting are not really be bugs. > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > encounter this error: > > --start > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > PortList.hasMoreElements: true > Listening on: /dev/ttyS0 > Client connected. > >From net: echo > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > --end > > I took a look at exception.h, and it seems as though the problematic > code does not exist in newer versions of Kaffe (I have been using > CVS-2004-11). Next week I will try to use a newer version, although so > far everything but CVS-2004-11 has failed. Also, I the device files I > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > something like this? > In RXTXCommDriver, just look for the following code and add /dev/ttyM to the list. Moxa? if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } So: if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyM", // for Moxa ports "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } Linux just has way too many port types to try enumerating them all. There is potential we can add them back in with udev now. > Thanks, > Max. > > > On 5/21/05, Trent Jarvi wrote: > > > I'm not sure what is wrong in the first part. It sounds like your > > > application may be swallowing an exception while trying to enumerate the > > > port or open it. The usual mistake made it not having permissions to > > > either open the port or create the lockfile. There should be examples in > > > the contrib directory you can try that enumerate and open ports. Maybe > > > that will give you some hints. > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > Sun's code limiting you there though you do need to compile and install > > > rxtx for the XScale with Sun's Commapi. > > > > > > -- > > > Trent Jarvi > > > tjarvi at qbang.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Wed Jun 8 12:16:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 08 Jun 2005 13:16:03 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A60B8D.8080500@cs.umn.edu> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> Message-ID: <42A735E3.8040706@atcorp.com> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual serial comport. This isn't so much of a problem, what is, however, is that the comport does not appear to be able to be set to any arbitrary speed, only those from the data_rate enum. I've not found much on using different speeds, has anyone else encountered anything similar? I greatly appreciate any and all comments and suggestions. Thanks in advance, ~ Shawn Lavelle From zempftman at gmail.com Wed Jun 8 12:50:58 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 14:50:58 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: Thanks Trent! That will solve one of the problems. I don't know when my next chance to work on it will be, but I still need to figure out the error I got when I tried opening '/dev/ttyS0' on the Moxa device regarding a failed assertion, seemed to be a Kaffe issue. Thanks for you help, hope to have results soon, Max Englander. On 6/8/05, Trent Jarvi wrote: > On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > > > ---------- Forwarded message ---------- > > From: Maxwell Zempftman > > Date: May 27, 2005 5:01 PM > > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > > To: rxtx at mail.linuxgrrls.org > > > > > > Here are the results from working this week: > > > > The "NullPointerExceptions" are generated by the software when I > > choose a bad device file. I discovered that this occurs on the > > i686-RedHat box as well. This exception seems to be generated only by > > this particular application, and not by the example programs in > > contrib. So, for example: > > > > java MyApp /dev/null <-- generates NullPointerException > > java MyApp fake <-- generates NullPointerException > > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > > > Using the program CommCheck > > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > > appears as though /dev/ttyS0 is the only valid serial device file on > > the XScale device, so the errors I was getting are not really be bugs. > > > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > > encounter this error: > > > > --start > > > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > > > PortList.hasMoreElements: true > > Listening on: /dev/ttyS0 > > Client connected. > > >From net: echo > > > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > > > --end > > > > I took a look at exception.h, and it seems as though the problematic > > code does not exist in newer versions of Kaffe (I have been using > > CVS-2004-11). Next week I will try to use a newer version, although so > > far everything but CVS-2004-11 has failed. Also, I the device files I > > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > > something like this? > > > > > In RXTXCommDriver, just look for the following code and add /dev/ttyM to > the list. Moxa? > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > So: > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyM", // for Moxa ports > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > Linux just has way too many port types to try enumerating them all. There > is potential we can add them back in with udev now. > > > > > Thanks, > > Max. > > > > > On 5/21/05, Trent Jarvi wrote: > > > > I'm not sure what is wrong in the first part. It sounds like your > > > > application may be swallowing an exception while trying to enumerate the > > > > port or open it. The usual mistake made it not having permissions to > > > > either open the port or create the lockfile. There should be examples in > > > > the contrib directory you can try that enumerate and open ports. Maybe > > > > that will give you some hints. > > > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > > Sun's code limiting you there though you do need to compile and install > > > > rxtx for the XScale with Sun's Commapi. > > > > > > > > -- > > > > Trent Jarvi > > > > tjarvi at qbang.org > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- > Trent Jarvi > tjarvi at qbang.org > From taj at www.linux.org.uk Wed Jun 8 12:53:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 19:53:10 +0100 (BST) Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A735E3.8040706@atcorp.com> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: On Wed, 8 Jun 2005, Shawn Lavelle wrote: > Hello, > I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate > with a virtual serial comport. This isn't so much of a problem, what > is, however, is that the comport does not appear to be able to be set to > any arbitrary speed, only those from the data_rate enum. I've not found > much on using different speeds, has anyone else encountered anything > similar? I greatly appreciate any and all comments and suggestions. > This problem is a bit more tricky than it should be. POSIX systems just have a few specified baud rates. Solaris is one of these systems. CommAPI baud rates probably came from someone looking at Solaris. RXTX tries to be POSIX like. W32 is treated as a POSIX like system via a termios.c file in rxtx. Serial ports have baudbase and divisor. So you can set these to come close to the baudrate you want. Some funky equipment like automobile test equipment use baud rates that are not really possible with PC hardware. But if you get as close as possible by changing baud base and divisor, it works. Windows can actually do this for you. I don't know exactly what their code does but if you pass a baudrate to windows, it will guestimate a baudbase and divisor. So you just pass it 10200 baud and it does its job. This is not of very much use the way rxtx does things though. Linux has the standard POSIX like baud rates but if you set the baud rate to B38400, you can set your own baud base and divisor. This is not POSIX that I know of. W32 has more capability than POSIX like systems too. So I did some work to have windows work like Linux via termios.c But the code is not quit right. SerialImp.c and termios.c need some work so all the various buadrates work on Linux and W32. Most other systems will not work beyond what CommAPI already specifies without writting kernel drivers. This is on my todo list but if someone gets to it first, all the better. -- Trent Jarvi tjarvi at qbang.org From carobizar at free.fr Thu Jun 9 06:39:10 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Thu, 9 Jun 2005 14:39:10 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: <1118320750.42a8386e6d3ce@imp5-q.free.fr> Hi ! Thank you for all your advices. I managed to use rxtx on Windows but I have still some difficulties on Linux. I have yet follow your instructions and the configure file has created : - librxtxSerial.so and librxtxParallel.so in the directory /usr/java/j2sdk1.4.2_08/jre/lib/i386 - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the directory /usr/java/j2sdk1.4.2_08/jre/lib - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext But when I run my program, Some exceptions occur : Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver So, 1) What have I forgotten ? 2) Is it possible to make my application run on Linux without the jdk (only the jre) ? Best regards, Caroline. From taj at www.linux.org.uk Thu Jun 9 07:28:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 9 Jun 2005 14:28:05 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118320750.42a8386e6d3ce@imp5-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: On Thu, 9 Jun 2005 carobizar at free.fr wrote: > Hi ! > Thank you for all your advices. > I managed to use rxtx on Windows but I have still some difficulties on Linux. > I have yet follow your instructions and the configure file has created : > - librxtxSerial.so and librxtxParallel.so in the directory > /usr/java/j2sdk1.4.2_08/jre/lib/i386 > - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the > directory /usr/java/j2sdk1.4.2_08/jre/lib > - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext > > But when I run my program, Some exceptions occur : > Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while > loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > com.sun.comm.SolarisDriver > > So, > 1) What have I forgotten ? > The native (.so) libraries are not installed in a directory the JRE is looking for native libraries in. You may look around and see where the .so libraries are in the JRE. I don't know that the jre/lib/i386 directory is specified as a required directory for JREs. I noticed some do not use it. You may try printing the java.libarary.path to see your options. It is also possible to alter the java.library.path. > 2) Is it possible to make my application run on Linux without the jdk (only the > jre) ? Yes. Though installation from source with the JDK is less error prone. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0002.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 7 15:03:09 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 07 Jun 2005 16:03:09 -0500 Subject: [Rxtx] Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <42A60B8D.8080500@cs.umn.edu> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual comport. This isn't so much of a problem, what is, however, is that the comport is only ever set to 9600 baud. I've not found this as a documented bug, has anyone else encountered anything similar? I'll try and provide more detail tomorrow, but if anyone has any suggestions or encountered this before, I'd like to hear about it. Thanks in advance, ~ Shawn Lavelle From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0002.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0002.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0002.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Mon Jun 20 01:04:40 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 20 Jun 2005 08:04:40 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: <42B66A88.4060806@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050620/9be208a1/attachment-0002.html From fbalzarro at libero.it Mon Jun 20 02:33:52 2005 From: fbalzarro at libero.it (Fabio Balzarro) Date: Mon, 20 Jun 2005 10:33:52 +0200 Subject: [Rxtx] RXTXPort:close detected bad file descriptor Message-ID: I'm using RXTX libraries on IPAQ 4150 PDA with Windows CE 4.20 and Jeode. When I close a serial port with sp.close() (where sp is a SerialPort) sometimes an error occour 1119256168085: RXTXPort:close detected bad file descriptor What can I do? Thanks Fabio ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From slavelle at atcorp.com Mon Jun 20 08:08:19 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 20 Jun 2005 09:08:19 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: <42B6CDD3.4040409@atcorp.com> It turns out that I did have a driver-not-used issue which has now been resolved and I can use RxTx on it (had to add ttyUSB as a valid port), but only at standard baud rates. Does USB have the same restrictions on port speed as regular RS232? ~ Shawn Trent Jarvi wrote: > Just a note here. > > I have requested a FTDI usb device and they offered to send one for the > purpose of trying to get rxtx working. I have no idea how long that takes > though. > > > On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > > >>I'm afraid we're just using the latest version from the FTDI website. I've >>not yet played with linux properly with this and unfortunately I run gentoo >>and haven't yet successfully compiled in the ftdi driver. I'll let you know >>if I get any success. >> >>Appologies >> >>Christopher >> >>-----Original Message----- >>From: rxtx-bounces at mail.electronpusher.org >>[mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle >>Sent: 15 June 2005 00:00 >>To: Java RXTX discussion >>Subject: Re: [Rxtx] Virtual Com Ports >> >>Hmm, the latter sounds like a lot of work. It does find the virtual comport >>in windows, i must have just missed it earlier (sign of a long day). On the >>linux side, I suspect that something is not correct with the driver >>installation becuase it does not give me a tty for it :( >> >>Christopher, May I ask what driver you are using for your FTDI chip? >>Did you ever encounter problems with not getting a tty assigned for it? >> >> >> Thanks for all your help! >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>They will have to show up as a tty device in Linux. Probably ttyUSB? >>>That will need an entry in RXTXCommDriver.java. If they dont show up >>>as a tty device, rxtx cant treat it like a serial port. It just wont >> >>work. >> >>>With COM3, rxtx will try to open the port and perform a timed out read. >>>Usually if a port is not there, the read blows up or the open blows up. >>>Timing out is fine. COM3 used to share interrupts with COM1. I know >>>you can reassign ports in XP. RXTX scans up through COM255. You may >>>try moving it. >>> >>> >>>The code in question is the following in RXTXCommDriver.java >>> >>> >>> if(osName.equals("Linux")) >>> { >>> String[] Temp = { >>> "ttyS", // linux Serial Ports >>> "ttySA", // for the IPAQs >>> "ttyUSB" // for USB frobs >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>> else if(osName.toLowerCase().indexOf("windows") != -1 ) >>> { >>> String[] Temp = { >>> "COM" // win32 serial ports >>> //"//./COM" // win32 serial ports >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>>If COM3 can be read, it should be found. the ttyUSB should work if >>>thats in the version of RXTXCommDriver.java you have. >>> >>>If this is still a problem, it may be that the driver is erroring on >>>what may be considered normal comm port operations such as setting the >>>speed, timeout, threshold, .. One would have to start looking at each >>>function called in the native open() and read(). >>> >>> >>> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>>seems to find the device using rxtx. Looking at the hardware >>>>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>>>linux. I can't seem to get it to show up as a tty(s#) in linux which >>>>is probably just due to my lack of significant linux knowledge. >>>> >>>> ~ Shawn >>>> >>>>Trent Jarvi wrote: >>>> >>>> >>>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>Has anyone here noticed that virtual comports do not get enumerated >>>>>>via CommPortIdentifier.getPortIdentifiers()?? >>>>>> >>>>>>The device I'm trying to talk to uses an fdti usb to serial >>>>>>convertor with a driver that has it show up as a virtual comport. I >>>>>>can enter this port manually and it will be usable but I cannot get >>>>>>it show up automatically (as in the simple serial demo). Any thoughts >> >>on this? >> >>>>> >>>>>Hi Shawn, >>>>> >>>>>What OS is this and what is the name of the virtual port you are >>>>>trying to open? I suspect the name just needs to be added to >> >>RXTXCommDriver.java. >> >>>>_______________________________________________ >>>>Rxtx mailing list >>>>Rxtx at mail.electronpusher.org >>>>http://www.electronpusher.org/mailman/listinfo/rxtx >>>> >>> >>> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From lyon at docjava.com Mon Jun 20 15:06:08 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 20 Jun 2005 17:06:08 -0400 Subject: [Rxtx] testing Message-ID: Hi All, I am testing my new multi-platform Java Webstart RXTX application (Trent: I could not have done it without you!). So far, I think it will work under Linux (x86), Windows XP, Windows 2000 and MacOS X. The application is available as a Java webstart application at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Edit:Preferences: SerialPort Setup... should bring up a dialog box that enables dialing via the modem. Generally, it does not find internal modems (except on the mac). Why, I don't know. Thanks in advance for trying this new app. All feedback on it is welcome. - Doug Lyon From jasmine at electronpusher.org Tue Jun 21 04:15:53 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Tue, 21 Jun 2005 11:15:53 +0100 Subject: [Rxtx] testing In-Reply-To: References: Message-ID: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > Hi All, > I am testing my new multi-platform Java Webstart RXTX application > (Trent: I could not have done it without you!). > > So far, I think it will work under Linux (x86), Windows XP, > Windows 2000 and MacOS X. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. -J. From taj at www.linux.org.uk Tue Jun 21 05:50:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 12:50:23 +0100 (BST) Subject: [Rxtx] testing In-Reply-To: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> References: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> Message-ID: On Tue, 21 Jun 2005, Jasmine Strong wrote: > > On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > > > Hi All, > > I am testing my new multi-platform Java Webstart RXTX application > > (Trent: I could not have done it without you!). > > > > So far, I think it will work under Linux (x86), Windows XP, > > Windows 2000 and MacOS X. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > on my Mac. > passing -source 1.3 -target 1.3 to javac will compile classes without this problem. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 10:19:25 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 11:19:25 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. Sincerely, Jeremyah Payne From ricardo.trindade at emation.pt Tue Jun 21 13:25:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 20:25:00 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B8698C.2060509@emation.pt> Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > From taj at www.linux.org.uk Tue Jun 21 13:39:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:39:43 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <42B8698C.2060509@emation.pt> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> <42B8698C.2060509@emation.pt> Message-ID: It looks like he has an rs422 device/converter. This is not the problematic 'trying to do protocol X with a serial port' situation unless I'm missing something. I'll follow up with the other email I started. On Tue, 21 Jun 2005, Ricardo Trindade wrote: > Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. > > Payne, Jeremyah L (N-CIM) wrote: > > >Good morning, my name is Jeremyah and I am working on a java project to > >interface with some devices. In short, I have a laptop with a PCMIA > >converter that does RS422 running windows 2000. I also will be > >installing some PCI cards into some Linux boxes that will have probably > >4-8 RS422 ports on them. After doing some reading in order to talk > >with these items using my existing java code I will need an additional > >driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > >trying to get a map sort of where I need to make changes. As I see it, > >I would need to subclass SerialPort to my RS422 interface. That would > >link with a DLL or SO implementation that talks with the hardware. I > >also need to change the listing of working ports in the lookup section > >for serial. Does this seem like I am on the right track? Appreciate > >the support. > > > > > >Sincerely, > >Jeremyah Payne > >_______________________________________________ > >Rxtx mailing list > >Rxtx at mail.electronpusher.org > >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 21 13:40:25 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:40:25 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: On Tue, 21 Jun 2005, Payne, Jeremyah L (N-CIM) wrote: > Good morning, my name is Jeremyah and I am working on a java project to > interface with some devices. In short, I have a laptop with a PCMIA > converter that does RS422 running windows 2000. I also will be > installing some PCI cards into some Linux boxes that will have probably > 4-8 RS422 ports on them. After doing some reading in order to talk with > these items using my existing java code I will need an additional > driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > trying to get a map sort of where I need to make changes. As I see it, I > would need to subclass SerialPort to my RS422 interface. That would link > with a DLL or SO implementation that talks with the hardware. I also > need to change the listing of working ports in the lookup section for > serial. Does this seem like I am on the right track? Appreciate the > support. > Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 13:40:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 14:40:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618954@emss02m08.us.lmco.com> I'd like to except I am dealing with NASA. I am basically building a system to monitor 100+ Units that communicate over RS422. They have some converters in place but want to get rid of them. I'll check through the archives. I had started looking yesterday as was leaving work. -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Ricardo Trindade Sent: Tuesday, June 21, 2005 2:25 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From slavelle at atcorp.com Tue Jun 21 14:58:06 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 21 Jun 2005 15:58:06 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: <42B87F5E.4000403@atcorp.com> > Linux has the standard POSIX like baud rates but if you set the baud rate > to B38400, you can set your own baud base and divisor. This is not POSIX > that I know of. W32 has more capability than POSIX like systems too. So > I did some work to have windows work like Linux via termios.c > > But the code is not quit right. SerialImp.c and termios.c need some > work so all the various buadrates work on Linux and W32. Most other > systems will not work beyond what CommAPI already specifies without > writting kernel drivers. > > This is on my todo list but if someone gets to it first, all the better. Hmm, I guess I didn't read this close enough before. Just to be clear, the pieces to setBaudBase and setDivisor are not yet implemented, correct? Thanks, Shawn From sean_montgomery at baseview.com Tue Jun 21 15:14:08 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 21 Jun 2005 17:14:08 -0400 Subject: [Rxtx] OS X installation - file locations Message-ID: <8AB82C7F-0D19-45F9-AE54-A12C59A8495E@baseview.com> Greetings, I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) using the RXTX installation instructions. RXTX worked fine. Basically you've got: - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions - javax.comm.properties in /System/Library/Frameworks/ JavaVM.framework/Home/lib - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ lib/ext My coworker was concerned that the installation required files to be placed in /System/Library... because those directories are "Apple's" and subject to change at Apple's whim, and that it would be safer (less likely to break when a user updates their OS or Java version or what have you) if all the files could be somewhere in /Library... or / Library/Java. My coworker points out that when 3rd party apps like FrontBase and JBoss need to communicate with Java their jars are placed in /Library/Java/Extensions. Granted that RXTX 2.0 is implementing javax.comm and not just a 3rd party extension, might that be the case - that javax.* stuff needs to be in the Java system files? I'm not the Java maven that my coworker is, so I don't know if any of this is gospel or not. Any OS X/Java experts out there willing to comment? We'd like to be able to install RXTX in the safest, most maintenance free way possible, but if there are specific reasons why javax.comm.properties and comm.jar need to be in /System... then so be it. Any information is welcome, Sean From ricardo.trindade at emation.pt Tue Jun 21 15:56:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 22:56:53 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B88D25.7060604@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050621/f6c9f5fe/attachment-0002.html From jeremyah.l.payne at lmco.com Tue Jun 21 15:22:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 16:22:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618955@emss02m08.us.lmco.com> -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Trent Jarvi Sent: Tuesday, June 21, 2005 2:40 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 As of yet we have not decided on the PCI boards to use yet So I am still waiting to se how we will interface to them. But the laptop is ready to use so ill build a test app for that API for now. The overview of class structure is really what I needed. I guess I will use the 2.1 as you suggested. Thanks for the help thus far! BTW, you guys wouldn't happen to keep class diagrams or anything of that nature around would you? If not I will probably end up having to do some anyway for documentation purposes, I could include them. Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From dmarkman at mac.com Tue Jun 21 18:13:28 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 21 Jun 2005 20:13:28 -0400 Subject: [Rxtx] OS X installation - file locations In-Reply-To: References: Message-ID: <044F520C-585C-4B99-82ED-3BA83DB8CE77@mac.com> Apple doesn't recommend to put jars into the /System/Library/Frameworks/JavaVM.framework/Home/lib/ext folder from other hands it's standard java directory to put extentions if you want to support comm api on whole system then I'd recommend to put jars into the /Library/Java/Extensions folder just like you did if you want to support comm api per user put your jars into the ~/ Library/Java/Extensions On Jun 21, 2005, at 5:14 PM, Java RXTX discussion wrote: > Greetings, > > > I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) > using the RXTX installation instructions. RXTX worked fine. > > > Basically you've got: > - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions > - javax.comm.properties in /System/Library/Frameworks/ > JavaVM.framework/Home/lib > - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ > lib/ext > > > My coworker was concerned that the installation required files to be > placed in /System/Library... because those directories are "Apple's" > and subject to change at Apple's whim, and that it would be safer > (less likely to break when a user updates their OS or Java version or > what have you) if all the files could be somewhere in /Library... or / > Library/Java. My coworker points out that when 3rd party apps like > FrontBase and JBoss need to communicate with Java their jars are > placed in /Library/Java/Extensions. Granted that RXTX 2.0 is > implementing javax.comm and not just a 3rd party extension, might > that be the case - that javax.* stuff needs to be in the Java system > files? > > > I'm not the Java maven that my coworker is, so I don't know if any of > this is gospel or not. Any OS X/Java experts out there willing to > comment? We'd like to be able to install RXTX in the safest, most > maintenance free way possible, but if there are specific reasons why > javax.comm.properties and comm.jar need to be in /System... then so > be it. > > > Any information is welcome, > > > Sean > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Dmitry Markman Dmitry Markman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050622/beea65d0/attachment-0002.html From lyon at docjava.com Thu Jun 23 04:39:47 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 23 Jun 2005 06:39:47 -0400 Subject: [Rxtx] web start + RXTX = strange errors? Message-ID: On: Date: Tue, 21 Jun 2005 11:15:53 +0100 From: Jasmine Strong Writes: An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. ----------- I cannot duplicate your error. My version of Java is: java -version java version "1.4.2_05" Is yours the same? Trent: You wrote: passing -source 1.3 -target 1.3 to javac will compile classes without this problem. ----------- OK, I have updated the disto to work with jdk1.3: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Jasmine: Is this working any better? Thanks! - DL From handzisk at tkn.tu-berlin.de Fri Jun 24 02:37:14 2005 From: handzisk at tkn.tu-berlin.de (Vlado Handziski) Date: Fri, 24 Jun 2005 10:37:14 +0200 (CEST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace Message-ID: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Hi all, let me first express my compliments on the great work you have done with the RXTX library. We have been using the library for some time, and we are at a point where we want to make our code public. For legacy reasons, the code that the RXTX library is bundled with, uses the javax.comm namespace. We have been using the ChangePackage script to change the RXTX2.1 package from gnu.io into javax.comm. We need the independent implementation since we want to be able to directly access /dev/ttyUSBx ports in linux and the CommAPI versions are just not as stable. On the download page, there is a comment that this is in violation of sun's license. Can someone shed more light on this. I was not aware that you can protect the names of the java packages. Best regards, Vlado From ricardo.trindade at emation.pt Fri Jun 24 04:01:17 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 11:01:17 +0100 Subject: [Rxtx] parity missed Message-ID: <42BBD9ED.3060004@emation.pt> Hi, I have a "parity missed error". From previous posts I believe this has to do with CMSPAR not being defined. I checked out 2.1 head from CVS. How can I make sure I do a proper build and CMSPAR is defined ? Perhaps it would be good to have a release snapshot that has this, I think the latest snapshot (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. Another question I have, is why must this depend on kernel headers, why can't it be defined in the RXTX source ? thanks Ricardo From jasmine at electronpusher.org Fri Jun 24 04:09:06 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 24 Jun 2005 11:09:06 +0100 Subject: [Rxtx] web start + RXTX = strange errors? In-Reply-To: References: Message-ID: <644aad2bdbba950f0a2fb12d7dcfd8a6@electronpusher.org> On 23 Jun 2005, at 11:39, Dr. Douglas Lyon wrote: > OK, I have updated the disto to work with jdk1.3: > http://show.docjava.com:8086/book/cgij/code/jnlp/ > addbk.JAddressBook.Main.jnlp > > Jasmine: Is this working any better? Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) -J. From taj at www.linux.org.uk Fri Jun 24 10:54:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 17:54:12 +0100 (BST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: On Fri, 24 Jun 2005, Vlado Handziski wrote: > Hi all, > > let me first express my compliments on the great work you have done with > the RXTX library. > > We have been using the library for some time, and we are at a point where > we want to make our code public. For legacy reasons, the code that the > RXTX library is bundled with, uses the javax.comm namespace. We have been > using the ChangePackage script to change the RXTX2.1 package from gnu.io > into javax.comm. We need the independent implementation since we want to > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > versions are just not as stable. > > On the download page, there is a comment that this is in violation of > sun's license. Can someone shed more light on this. I was not aware that > you can protect the names of the java packages. > > Best regards, > Vlado > I can't provide legal advice as I am not a lawyer. (v) may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are contained in the "java", "javax" or "sun" packages or similar as specified by Sun in any class file naming convention; and The license is in the commapi package from Sun. The above is also in all the EULA's you click through to download from Sun if I'm not mistaken. Simply put, the license taints developers that agree to it. For those developers, Sun has control of the javax.comm namespace. It really does not make sense to put rxtx 2.1 in the javax.comm namespace. It will only cause confusion which I think is the point of the clause above. The gnu.io namespace was perhaps a poor choice and just tossed in when reviewing the license to get out of Sun's namespace. There is nothing in the rxtx license limiting your freedom in this fashion though. Many companies are moving to gnu.io and some distribute it with popular applications you would recognize. I'm tempted to ask you not to contaminate rxtx 2.1 with the javax.comm namespace. You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) extensions to existing classes (which I dont think you are using); it is not just javax.comm. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 24 13:24:09 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 20:24:09 +0100 (BST) Subject: [Rxtx] parity missed In-Reply-To: <42BBD9ED.3060004@emation.pt> References: <42BBD9ED.3060004@emation.pt> Message-ID: On Fri, 24 Jun 2005, Ricardo Trindade wrote: > Hi, > > I have a "parity missed error". From previous posts I believe this > has to do with CMSPAR not being defined. > I checked out 2.1 head from CVS. How can I make sure I do a proper > build and CMSPAR is defined ? Perhaps it would be good to have a release > snapshot that has this, I think the latest snapshot > (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. > > Another question I have, is why must this depend on kernel headers, > why can't it be defined in the RXTX source ? > I used to cheat and grab the CMSPAR from the kernel headers because glibc did not have it. Now rxtx uses the glibc headers and we have a patch in glibc I trust that handles this. It would not be right to override glibc and it wasnt right to use the kernel headers (it really did cause problems). You can override glibc for now with the following in the top of SerialImp.c # define CMSPAR 010000000000 You can check if your distro headers have this right bit looking for the above in bits/termios.h. It should look like this: #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif If it is not defined, please file a bug with your distro as rxtx is not the only thing that will be broken on that distro. I was going to release new cvs snapshots last weekend but got tied up. I'll do it this weekend. I also need to get custom baudrate patches into the cvs snapshot. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Fri Jun 24 13:56:50 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 20:56:50 +0100 Subject: [Rxtx] parity missed In-Reply-To: References: <42BBD9ED.3060004@emation.pt> Message-ID: <42BC6582.2070805@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050624/e3b39631/attachment-0002.html From vlado.handziski at gmail.com Sat Jun 25 06:25:52 2005 From: vlado.handziski at gmail.com (Vlado Handziski) Date: Sat, 25 Jun 2005 14:25:52 +0200 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: <697986ec05062505256ebf381f@mail.gmail.com> Thanks for the clarification. Since changing the bundled source is not an option at this moment, we will consider using javax.comm and RXTX2.0. In the next rewrite, we would probably move to gnu.io . Best regards, Vlado Handziski On 6/24/05, Trent Jarvi wrote: > > On Fri, 24 Jun 2005, Vlado Handziski wrote: > > > Hi all, > > > > let me first express my compliments on the great work you have done with > > the RXTX library. > > > > We have been using the library for some time, and we are at a point > where > > we want to make our code public. For legacy reasons, the code that the > > RXTX library is bundled with, uses the javax.comm namespace. We have > been > > using the ChangePackage script to change the RXTX2.1 package from gnu.io > > into javax.comm. We need the independent implementation since we want to > > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > > versions are just not as stable. > > > > On the download page, there is a comment that this is in violation of > > sun's license. Can someone shed more light on this. I was not aware that > > you can protect the names of the java packages. > > > > Best regards, > > Vlado > > > > I can't provide legal advice as I am not a lawyer. > > (v) may not create, or authorize your licensees to create additional > classes, interfaces, or subpackages that are contained in the "java", > "javax" or "sun" packages or similar as specified by Sun in any class file > naming convention; and > > The license is in the commapi package from Sun. The above is also in all > the EULA's you click through to download from Sun if I'm not mistaken. > > Simply put, the license taints developers that agree to it. For those > developers, Sun has control of the javax.comm namespace. > > It really does not make sense to put rxtx 2.1 in the javax.comm namespace. > It will only cause confusion which I think is the point of the clause > above. The gnu.io namespace was perhaps a poor choice and > just tossed in > when reviewing the license to get out of Sun's namespace. > > There is nothing in the rxtx license limiting your freedom in this fashion > though. Many companies are moving to gnu.io and some > distribute it with > popular applications you would recognize. I'm tempted to ask you not > to contaminate rxtx 2.1 with the javax.comm namespace. > > You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm > using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) > extensions to existing classes (which I dont think you are using); it is > not just javax.comm. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050625/1dadc50e/attachment-0002.html From taj at www.linux.org.uk Sun Jun 26 11:34:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 26 Jun 2005 18:34:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. Message-ID: The attached file should fix baud_base and divisor extensions for Linux The patch is against rxtx 2.1 CVS HEAD. To use this patch, you should set the baud rate to 38400. You can then try SerialPort.setBaudBase(int) and SerialPort.setDivisor(int) There are matching int SerialPort.getBaudBase() and int SerialPort.getDivisor(). What baud bases are available depends upon the serial port card and its driver so this is a bit of a blind attempt on my part. I've looked at the w32 API and I dont see anything available yet. The w32 code in RXTX will probably be figuring out the baud rate based on the tried baud base and divisor and just slamming it at the API for now (the API does something with that but I've not found real documentation on what it does). I dont want to try tinkering with the UART directly yet as that would involve poking machine memory directly and could very easily be error prone in bad ways. I don't expect Solaris or any SysV UNIX systems to work at all with this - ever. It is not standard in any way and will throw Exceptions on everything but Linux (w32 will just fail miserably as it is 1/2 implemented). If anyone has looked at custom baud rates before and has some thoughts or just wants to try the attached untested patch, I'd appreciate any feedback. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- ? autom4te.cache ? build ? output cvs server: Diffing . Index: configure =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure,v retrieving revision 1.35.2.59 diff -u -r1.35.2.59 configure --- configure 16 Oct 2004 16:20:34 -0000 1.35.2.59 +++ configure 26 Jun 2005 16:59:28 -0000 @@ -9644,6 +9644,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { #if defined (__GLIBC__) @@ -9782,6 +9784,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { @@ -9825,7 +9829,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -9837,7 +9841,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 26 Jun 2005 16:59:28 -0000 @@ -218,6 +218,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { #if defined (__GLIBC__) @@ -356,6 +358,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { @@ -399,7 +403,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -411,7 +415,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" cvs server: Diffing CNI cvs server: Diffing MACOSX_IDE cvs server: Diffing MACOSX_IDE/CW cvs server: Diffing MACOSX_IDE/ForPackageMaker cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions cvs server: Diffing MACOSX_IDE/ForPackageMaker/Resources cvs server: Diffing MACOSX_IDE/PB cvs server: Diffing WinCE cvs server: Diffing contrib cvs server: Diffing debian cvs server: Diffing src Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 26 Jun 2005 16:59:29 -0000 @@ -2079,15 +2079,17 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int BaudBase The clock frequency divided by 16. Default * BaudBase is 115200. * @return boolean true on success - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:setBaudBase()"); @@ -2097,10 +2099,11 @@ /** * Extension to CommAPI * @return int BaudBase - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getBaudBase() throws UnsupportedCommOperationException + public int getBaudBase() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getBaudBase()"); @@ -2108,13 +2111,14 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, IOException { if ( debug ) z.reportln( "RXTXPort:setDivisor()"); @@ -2124,10 +2128,11 @@ /** * Extension to CommAPI * @returns int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getDivisor() throws UnsupportedCommOperationException + public int getDivisor() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getDivisor()"); Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 26 Jun 2005 16:59:30 -0000 @@ -1877,16 +1877,27 @@ int fd = get_java_var( env, jobj,"fd","I" ); struct serial_struct sstruct; + if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) + { + goto fail; + } + + sstruct.baud_base = (int) BaudBase; + if ( sstruct.baud_base < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetBaudBase", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetBaudBase", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1914,9 +1925,13 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) ( sstruct.baud_base ) ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetBaudBase", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetBaudBase", strerror( errno ) ); @@ -1950,19 +1965,23 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } if ( sstruct.custom_divisor < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetDivisor", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetDivisor", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1971,7 +1990,7 @@ accept: none perform: Find the Divisor used for custom speeds - return: Divisor + return: Divisor negative value on error. exceptions: Unsupported Comm Operation on systems not supporting TIOCGSERIAL comments: @@ -1990,10 +2009,14 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) sstruct.custom_divisor ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetDivisor", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetDivisor", strerror( errno ) ); @@ -2032,7 +2055,7 @@ /* Open and lock the port so nothing else changes the setting */ - if ( LOCK( filename, pid ) ) goto fail;; + if ( LOCK( filename, pid ) ) goto fail; fd = find_preopened_ports( filename ); if( !fd ) Index: src/SerialPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/Attic/SerialPort.java,v retrieving revision 1.3.2.9 diff -u -r1.3.2.9 SerialPort.java --- src/SerialPort.java 12 Oct 2004 08:59:28 -0000 1.3.2.9 +++ src/SerialPort.java 26 Jun 2005 16:59:30 -0000 @@ -103,13 +103,17 @@ public abstract String getUARTType() throws UnsupportedCommOperationException; public abstract boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getBaudBase() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getDivisor() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setLowLatency() throws UnsupportedCommOperationException; public abstract boolean getLowLatency() cvs server: Diffing src/lfd cvs server: Diffing src/psmisc From uwe at kubosch.no Mon Jun 27 14:13:57 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Mon, 27 Jun 2005 22:13:57 +0200 Subject: [Rxtx] RXTX on FC4 Message-ID: <1119903238.2989.27.camel@BPC0276> Hi all! I just got RXTX to work on Fedora Core 4. The standard download did not work. I had to check the code out from CVS and build it, but then it worked flawlessly. Thanks for your good work. Now I wonder if I should contribute the compiled files so that others will have an easier time than me getting RXTX to work on FC4. What do I do? Who do I talk to? donV From taj at www.linux.org.uk Mon Jun 27 14:29:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 27 Jun 2005 21:29:46 +0100 (BST) Subject: [Rxtx] RXTX on FC4 In-Reply-To: <1119903238.2989.27.camel@BPC0276> References: <1119903238.2989.27.camel@BPC0276> Message-ID: On Mon, 27 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I just got RXTX to work on Fedora Core 4. > > The standard download did not work. > > I had to check the code out from CVS and build it, but then it worked > flawlessly. > > Thanks for your good work. > > Now I wonder if I should contribute the compiled files so that others > will have an easier time than me getting RXTX to work on FC4. What do I > do? Who do I talk to? > > The best thing to do with FC is to contibute an extras RPM. Debian does something like this with their .deb packaging. As rxtx is OS neutral, it is almost impossible to have everything on rxtx.org. If you do get a package in Fedora Extras, I can point a link there. The extra's mail list is here: https://www.redhat.com/mailman/listinfo/fedora-extras-list If it would help to have me release a 'stable' .tar.gz of the source for the RPM submittal process I can do that. It would also trigger upgrades in debian which would not be bad. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Mon Jun 27 16:23:20 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 27 Jun 2005 17:23:20 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: Message-ID: <42C07C58.1030608@atcorp.com> Hey Trent, I installed it and now I get IOExceptions instead of the other one. I'm not sure how those changes would have enabled setDivisor and setBaudBase to work though. Is it significant that this is a USB device emulating a serial port? ~ Shawn From taj at www.linux.org.uk Mon Jun 27 18:07:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 01:07:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: <42C07C58.1030608@atcorp.com> References: <42C07C58.1030608@atcorp.com> Message-ID: On Mon, 27 Jun 2005, Shawn Lavelle wrote: > Hey Trent, > I installed it and now I get IOExceptions instead of the other one. > I'm not sure how those changes would have enabled setDivisor and > setBaudBase to work though. Is it significant that this is a USB device > emulating a serial port? > The USB driver probably does not support this. With USB, the ioctl()'s appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through the linux drivers/usb tree and found to ioctl to support this in Linux 2.6.10. RXTX is not doing very much magic, the patch really only gets the serial struct instead of writing a structure with random values for baudbase and handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel level driver issue not a user space library issue. So if you wanted this to work, the usb serial driver would have to handle the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression after looking through the USB tree quickly. I hope that helps. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Jun 27 18:25:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 27 Jun 2005 20:25:22 -0400 Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) Message-ID: Hi All, I wrote: Jasmine: Is this working any better? And Jasmine says: Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) I am using -source 1.3 and -target 1.3 for the compilation, however, we still seem to have this problem, which my machine (for some reason) does not have. Does anyone have any ideas about what might be the problem? Thanks! - DL From taj at www.linux.org.uk Mon Jun 27 19:04:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 02:04:37 +0100 (BST) Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) In-Reply-To: References: Message-ID: On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I wrote: > Jasmine: Is this working any better? > > And Jasmine says: > Nope. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > > I am using -source 1.3 and -target 1.3 > for the compilation, however, we still seem to have this problem, > which my machine (for some reason) does not have. > Does anyone have any ideas about what might be the problem? > This has shown up in the past with jdk 1.5 compiled jars running on jre 1.4 machines. My guess is either jasmine has an old copy of rxtx with the problem on her machine that is being picked up on the classpath or you have not tried this with jre 1.4. The suggested -source/target fix should avoid the problem. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Mon Jun 27 21:23:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 04:23:55 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: On Tue, 28 Jun 2005, Trent Jarvi wrote: > On Mon, 27 Jun 2005, Shawn Lavelle wrote: > > > Hey Trent, > > I installed it and now I get IOExceptions instead of the other one. > > I'm not sure how those changes would have enabled setDivisor and > > setBaudBase to work though. Is it significant that this is a USB device > > emulating a serial port? > > > > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > > RXTX is not doing very much magic, the patch really only gets the serial > struct instead of writing a structure with random values for baudbase and > handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel > level driver issue not a user space library issue. > > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. > > I hope that helps. > > > It may be possible that you can just modify translate_speed and get_java_baudrate in SerialImp.c to have the new high speds you are after. The defines are in /usr/include/termios.h. #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 You can see many of these are not handled. I dont think CommAPI handled more than 57600 or so. int get_java_baudrate( int native_speed ) { switch( native_speed ) { case B0: return 0; case B50: return 50; case B75: return 75; case B110: return 110; case B134: return 134; case B150: return 150; case B200: return 200; case B300: return 300; case B600: return 600; case B1200: return 1200; case B1800: return 1800; case B2400: return 2400; case B4800: return 4800; case B9600: return 9600; case B19200: return 19200; case B38400: return 38400; case B57600: return 57600; default: return -1; } } int translate_speed( JNIEnv *env, jint speed ) { LEAVE( "RXTXPort:translate_speed" ); switch( speed ) { case 0: return B0; case 50: return B50; case 75: return B75; case 110: return B110; case 134: return B134; case 150: return B150; case 200: return B200; case 300: return B300; case 600: return B600; case 1200: return B1200; case 1800: return B1800; case 2400: return B2400; case 4800: return B4800; case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; #ifdef B57600 case 57600: return B57600; #endif /* B57600 */ #ifdef B115200 case 115200: return B115200; #endif /* B115200 */ #ifdef B230400 case 230400: return B230400; #endif /* B230400 */ #ifdef B460800 case 460800: return B460800; #endif /* B460800 */ #ifdef B14400 case 14400: return B14400; #endif /* B14400 */ #ifdef B28800 case 28800: return B28800; #endif /* B28800 */ #ifdef B128000 /* dima */ case 128000: return B128000; #endif /* dima */ #ifdef B256000 /* dima */ case 256000: return B256000; #endif /* dima */ } /* Handle custom speeds */ if( speed >= 0 ) return speed; else { LEAVE( "RXTXPort:translate_speed: Error condition" ); return -1; } } -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 28 05:20:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 28 Jun 2005 07:20:21 -0400 Subject: [Rxtx] cross-compilation using Make for Mac Message-ID: Hi All, Please excuse the long post; Trent said: >" >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. " Here is what I have on the mac version: java -version java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) When I run: http://show.docjava.com:8086/book/cgij/code/jnlp/math.benchmarks.Dhry.jnlp I get: -- listing properties -- jnlpx.heapsize=NULL,NULL jnlpx.splashport=-1 java.runtime.name=Java(TM) 2 Runtime Environment, Stand... java.protocol.handler.pkgs=com.sun.javaws.net.protocol sun.boot.library.path=/System/Library/Frameworks/JavaVM.fra... java.vm.version=1.4.2-38 awt.nativeDoubleBuffering=true gopherProxySet=false http.auth.serializeRequests=true java.vm.vendor="Apple Computer, Inc." java.vendor.url=http://apple.com/ path.separator=: java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io jnlpx.home=/Applications/Utilities/Java/Java Web... user.country=US sun.os.patch.level=unknown java.vm.specification.name=Java Virtual Machine Specification user.dir=/ java.runtime.version=1.4.2_05-141.4 java.awt.graphicsenv=apple.awt.CGraphicsEnvironment java.endorsed.dirs=/System/Library/Frameworks/JavaVM.fra... os.arch=ppc java.io.tmpdir=/tmp line.separator= java.vm.specification.vendor=Sun Microsystems Inc. jnlpx.remove=false os.name=Mac OS X sun.java2d.fontpath= java.library.path=/Applications/Utilities/Java/Java Web... java.specification.name=Java Platform API Specification java.class.version=48.0 jnlpx.deployment.user.home=/Users/lyon/Library/Caches/Java Web S... java.util.prefs.PreferencesFactory=java.util.prefs.MacOSXPreferencesFactory os.version=10.3.9 user.home=/Users/lyon user.timezone=America/New_York java.security.policy=file:/Applications/Utilities/Java/Jav... java.awt.printerjob=apple.awt.CPrinterJob trustProxy=true java.specification.version=1.4 file.encoding=MacRoman jnlpx.deployment.system.home=/Applications/Utilities/Java/J2SE 5.0... user.name=lyon java.class.path=/Applications/Utilities/Java/Java Web... java.vm.specification.version=1.0 sun.arch.data.model=32 java.home=/System/Library/Frameworks/JavaVM.fra... java.specification.vendor=Sun Microsystems Inc. user.language=en awt.toolkit=apple.awt.CToolkit java.vm.info=mixed mode java.version=1.4.2_05 java.ext.dirs=/Users/lyon/Library/Java/Extensions:/... sun.boot.class.path=/System/Library/Frameworks/JavaVM.fra... java.vendor=Apple Computer, Inc. file.separator=/ java.vendor.url.bug=http://developer.apple.com/java/ sun.cpu.endian=big sun.io.unicode.encoding=UnicodeBig mrj.version=141.3 jnlpx.jvm=/System/Library/Frameworks/JavaVM.fra... sun.cpu.isalist= sun.awt.exception.handler=apple.awt.CToolkit$EventQueueExceptio... javawebstart.version=javaws-1.4.2_05 800 mhz g4,878k ds/sec total time: 1184ms Result: 844594 dhrystone/sec. Load average for last 15 minutes:0.62 So, I feel pretty sure that I have tried this with 1.4. As to modifying the RXTX compilation, that I did not do...and I take your point. I have been using the binary distributions as is. Oops. I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Now when I do a make, I get: make gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known libtool: link: warning: undefined symbols not allowed in i386-pc-mingw32 shared libraries rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ln: `SerialImp.o': File exists make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 So, I do a make clean, then a make: .... (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ar cru .libs/librxtxSerial.a /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o ar: /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o: No such file or directory make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 In the i386 directory, there is a symbolic link left from something: ls -al SerialImp.o lrwxrwxrwx 1 lyon lyon 12 Jun 28 07:03 SerialImp.o -> SerialImp.lo However, the SerialImp.lo is not present (which is the cause of the error, I think). On the other hand, the file I am looking for is present in: i686-pc-linux-gnu Possibly the i386 generation is not clean (of course it is also likely that I am just asking dumb questions, being a newbie to the code and all.). Finally, will this make file regenerate the distro for the mac? I found some really old (from year 2001) files in: cvs/MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions Which I could use for the distro...but I would prefer to do a clean, multi-platform build from make. Thanks! - Doug >On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > >> Hi All, >> I wrote: >> Jasmine: Is this working any better? >> >> And Jasmine says: >> Nope. >> >> An error occurred while launching/running the application. >> >> Title: addbk.JAddressBook.Main >> Vendor: DocJava, Inc. >> Category: Unexpected Error >> >> gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) >> >> > > I am using -source 1.3 and -target 1.3 >> for the compilation, however, we still seem to have this problem, >> which my machine (for some reason) does not have. >> Does anyone have any ideas about what might be the problem? >> > >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. > > >The suggested -source/target fix should avoid the problem. > >-- >Trent Jarvi >tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 28 09:43:41 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 28 Jun 2005 10:43:41 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: <42C1702D.1070307@atcorp.com> > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. There is ioctl stuff in the driver for the chip, but i haven't seen the TIOC*SERIAL entries. That might be why it continues to fail. I did get around the problem, though, by hacking the driver and just specifying the baud rate I need. Now everything works well. Thanks for all the assistance you've provided. ~ Shawn M. Lavelle From taj at www.linux.org.uk Tue Jun 28 12:42:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:42:29 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known Add a compiler flag -DWIN32 The code above should not be compiling on w32 as it is #if !defined(WIN32) You can look at the bottom of Makefile.in to see the w32 compile flags. Search for "WIN32 CrossCompiling from here down" If its still not working, I can set you up with the Bob account. Just email me off the list. W32 compiling is a bit complicated. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 28 12:52:50 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:52:50 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Nods. I did change configure but right now it is only in the baudbase/divisor patch I posted. I'm going to add several extension baud rates that can be supported by normal API calls and commit that today as a followup to my comments yesterday on baudrates. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Wed Jun 29 01:52:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 08:52:10 +0100 (BST) Subject: [Rxtx] [PATCH] More baud rate fixes Message-ID: I went through the native baudrate conversion from Java and added several. This patch is against CVS 2.1 head. I think thats it for baud rate fixes unless someone see something. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- A non-text attachment was scrubbed... Name: baud_base_and_divisor_plus_odd_baudrates.diff.gz Type: application/x-gzip Size: 3291 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050629/4c1ef1c2/baud_base_and_divisor_plus_odd_baudrates.diff-0002.gz From lyon at docjava.com Wed Jun 29 10:33:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 29 Jun 2005 12:33:45 -0400 Subject: [Rxtx] java.comm dependencies Message-ID: Hi All, During a build of the rxtx code, I have left the javax.comm out of the system (on purpose). However, I get an error, at run time: CommPortIdentifier:static initialization() apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: javax/comm/CommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver I am thinking that there is something in the gnu.io.CommPortIdentifier that seeks to load the javax.comm.CommDriver. It was my understanding that we could write code without reference to the javax.comm.CommDriver and that we could work in the gnu namespace. Is this true? Thanks! - Doug From taj at www.linux.org.uk Wed Jun 29 11:16:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 18:16:08 +0100 (BST) Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > During a build of the rxtx code, I have left the > javax.comm out of the system (on purpose). > However, I get an error, at run time: > > CommPortIdentifier:static initialization() > apple.awt.EventQueueExceptionHandler Caught Throwable : > java.lang.NoClassDefFoundError: javax/comm/CommDriver > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > that seeks to load the javax.comm.CommDriver. > > It was my understanding that we could write code without reference > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > Is this true? > Yes. People use 2.1 without javax all the time. There should be no reference to javax at all in rxtx 2.1. You may check your code. I just did a grep through 2.1 and there is nothing. You may look at the classes you are using. If you find javax.comm in your code, replace it with gnu.io and that should be all you need to do. -- Trent Jarvi tjarvi at qbang.org From jayant28k at gmail.com Wed Jun 29 21:49:28 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Thu, 30 Jun 2005 09:19:28 +0530 Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: <6a6a02310506292049778c452f@mail.gmail.com> Trent, I think best idea is to have wiki for rxtx code. So as the traffic is increasing with time. "RXTX" seems to be more popular in embbeded system. Sun Microsystems will always apperciate your efforts on parallel and serial ports commincation based application in IT Industry. Thanks for your help on this forum as "ONE MAN ARMY" ;-) Cheers, Jayant On 6/29/05, Trent Jarvi wrote: > On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > > > Hi All, > > During a build of the rxtx code, I have left the > > javax.comm out of the system (on purpose). > > However, I get an error, at run time: > > > > CommPortIdentifier:static initialization() > > apple.awt.EventQueueExceptionHandler Caught Throwable : > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > > that seeks to load the javax.comm.CommDriver. > > > > It was my understanding that we could write code without reference > > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > > > Is this true? > > > > Yes. People use 2.1 without javax all the time. > > There should be no reference to javax at all in rxtx 2.1. You may check > your code. I just did a grep through 2.1 and there is nothing. You may > look at the classes you are using. > > If you find javax.comm in your code, replace it with gnu.io and that > should be all you need to do. > > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From uwe at kubosch.no Sat Jun 25 02:50:24 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Sat, 25 Jun 2005 10:50:24 +0200 Subject: [Rxtx] RXTX in FC3/FC4 Message-ID: <1119689424.12606.14.camel@BPC0276> Hi all! I am trying to get RXTX to work on Fedora Core, version 3 or 4. I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext directory. I have edited the jre/lib/javax.comm.properties according to the docs. I have tried this with both rxtx 2.0 and 2.1. I have tried on two different machines. I have tried with java 1.4.2 and java 1.5.0, both from Sun. I always get a signall 11 from the native libraries when they are loaded. Is this a common problem? Any help is greatly appreciated. Below is the start of the error message. More can be supplied on demand. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x65015A Function=(null)+0x65015A Library=/lib/ld-linux.so.2 NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) - locked <0xed46f628> (a java.util.Vector) - locked <0xed471708> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xed46ebc0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.InitializeDriver(CommPortIdentifier.java:213) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:248) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:351) at com.jpeterson.x10.module.CM11A.allocate(CM11A.java:1160) at net.sourceforge.cruisecontrol.publishers.X10Publisher.send(X10Publisher.java:182) at net.sourceforge.cruisecontrol.publishers.X10Publisher.turnOff(X10Publisher.java:171) at net.sourceforge.cruisecontrol.publishers.X10Publisher.handleBuild(X10Publisher.java:148) at net.sourceforge.cruisecontrol.publishers.X10Publisher.publish(X10Publisher.java:141) at net.sourceforge.cruisecontrol.Project.publish(Project.java:679) at net.sourceforge.cruisecontrol.Project.build(Project.java:227) at net.sourceforge.cruisecontrol.Project.execute(Project.java:153) at net.sourceforge.cruisecontrol.ProjectWrapper.run(ProjectWrapper.java:66) at java.lang.Thread.run(Thread.java:534) From chris_jh at blueyonder.co.uk Tue Jun 28 05:37:10 2005 From: chris_jh at blueyonder.co.uk (Christopher Harris) Date: Tue, 28 Jun 2005 12:37:10 +0100 Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError Message-ID: <42C13666.9030108@blueyonder.co.uk> Hi I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 32bit) The serial ports work fine with no issues, but when i try to use the parallel port i get this message Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:66) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) I am trying to print a line out to port "/dev/lp0" At first i thought it could not find the librxtxParallel.so file, but when i renamed it i got a different saying it could not find the library. I have tried to run as root no difference. It is really weird, i get no compile errors and the serial ports work fine. I changed the LPRPort.java and commented out the Initialize call method. And just get the same error but for the method open. It is as though it can't see the methods, and yet it can see the library. I did have a bit of check of the JNI implementation in rxtx but could not spot anything. Yours Thankfully Christopher Harris From lyon at docjava.com Thu Jun 30 02:28:09 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 04:28:09 -0400 Subject: [Rxtx] tools Message-ID: Hi All, I have been thinking about automatic cross-platform native method development of Java/C programs. It appears that different binary tools are needed to target different platforms. Configuration seems a bit painful. Is there something better available than make? Is ANT any good at this? Has anyone tried: http://jnipp.sourceforge.net/ Thanks! - Doug From lyon at docjava.com Thu Jun 30 04:11:17 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 06:11:17 -0400 Subject: [Rxtx] javax.comm Message-ID: Hi All, When I load my jar files on a linux box, all is well. However, when I load them on a mac, I get: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver The jar files for the mac are different from the jar files for linux, because recompilation of the native code for the mac has not been easy, for me. As a result, the RXTX jars are tending toward specific versions and platforms. Probably, this is not an ideal situation, but, I suspect, it is common. I have an idea that we could create a single JNLP distro site that we can make reference to that would enable a uniform repository of synchronized signed native methods and jars for RXTX. For example, the one-wire Maxim folks have a real-nice approach where their stuff makes reference to another JNLP file that contains all the stuff we need to make RXTX work. Check it out at: http://www.maxim-ic.com/products/ibutton/software/1wire/OneWireViewer.cfm However, even they have problems on an unconfigured machine: Specified adapter name "DS9097U" is not known * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cannot load default adapter. Please check that the adapter is connected and that no other application is using the port. If you have checked the adapter, the default port might not be selected. Either set the value of the TMEX default using the utility provided with the TMEX Runtime, or create a new file in the /lib folder called onewireviewer.properties with two lines, similar to the following: #native win32 drivers adapter.name={DS9097U} adapter.port=COM1 #or javax.comm drivers adapter.name=DS9097U adapter.port=COM1 The full path to this file should be: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/onewireviewer.properties ---- Wow, that is a show stopper! Configuration is something that we really need to think about as an automatic thing, particularly for web start users. You can't ask a person who wants to run an application to figure out how to alter a properties file. If you know you need one, then get permission and make one...automatically. That makes a lot of sense, to me. Basically, we need an installer. At the very least, all the pre-built binaries and jars needed for the RXTX package on several platforms should be available from a single place. One this happens, we can make a JNLP file that is platform specific, but can give us a level of indirection. Is this something that has been done already? Thanks! - Doug From taj at www.linux.org.uk Thu Jun 30 08:10:22 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 15:10:22 +0100 (BST) Subject: [Rxtx] tools In-Reply-To: References: Message-ID: On Thu, 30 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I have been thinking about automatic cross-platform > native method development of Java/C programs. > > It appears that different binary tools are needed to target different > platforms. Configuration seems a bit painful. > > Is there something better available than make? > > Is ANT any good at this? I'm far from an Ant expert but have used it for other projects. The main problem I see with ant is there is no mainstream support for platform neutral neutral library creation as far as I can tell. I think ant is a fine replacement for make but I've not seen a suitable replacement for autoconf. At that point, make is as good as anything. It should be possible to create a ant build.xml that works on say Solaris, Linux, Windows and Mac OS X. The problem is when you are trying to build a library for embeded ARM from Mac OS X. > Has anyone tried: > http://jnipp.sourceforge.net/ -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:22:02 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:22:02 +0100 (BST) Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <1119689424.12606.14.camel@BPC0276> References: <1119689424.12606.14.camel@BPC0276> Message-ID: On Sat, 25 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I am trying to get RXTX to work on Fedora Core, version 3 or 4. > > I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 > directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext > directory. > > I have edited the jre/lib/javax.comm.properties according to the docs. > > I have tried this with both rxtx 2.0 and 2.1. > > I have tried on two different machines. > > I have tried with java 1.4.2 and java 1.5.0, both from Sun. > > I always get a signall 11 from the native libraries when they are > loaded. Is this a common problem? Any help is greatly appreciated. > Below is the start of the error message. More can be supplied on > demand. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x65015A > Function=(null)+0x65015A > Library=/lib/ld-linux.so.2 > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) If you compile rxtx from source, this will probably go away. I'm not sure what the exact cause is but it looks like the binaries are not suitable for FC3/4. The ABI may have changed since those had been compiled. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:26:56 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:26:56 +0100 (BST) Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError In-Reply-To: <42C13666.9030108@blueyonder.co.uk> References: <42C13666.9030108@blueyonder.co.uk> Message-ID: tOn Tue, 28 Jun 2005, Christopher Harris wrote: > Hi > > I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 > 32bit) > > The serial ports work fine with no issues, but when i try to use the > parallel port i get this message > > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:66) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) > > > I am trying to print a line out to port "/dev/lp0" > > At first i thought it could not find the librxtxParallel.so file, but > when i renamed it i got a different saying it could not find the library. > > I have tried to run as root no difference. > > It is really weird, i get no compile errors and the serial ports work fine. > > I changed the LPRPort.java and commented out the Initialize call method. > And just get the same error but for the method open. > > It is as though it can't see the methods, and yet it can see the library. > I did have a bit of check of the JNI implementation in rxtx but could > not spot anything. > > > You can check if the symbols are in the shared library: nm librxtxSerial.so |grep Initialize If the symbols are not there, there was a build error. Watch very close for build errors while compiling from source. I suspect something isnt behaving right. -- Trent Jarvi tjarvi at qbang.org From allen at adbyrne.us Thu Jun 30 06:55:58 2005 From: allen at adbyrne.us (Allen Byrne) Date: Thu, 30 Jun 2005 07:55:58 -0500 Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> References: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> Message-ID: <200506300755.59159.allen@adbyrne.us> On Thursday 30 June 2005 00:31, rxtx-request at mail.electronpusher.org wrote: > >Message: 8 >Date: Sat, 25 Jun 2005 10:50:24 +0200 >From: Uwe Kubosch >Subject: [Rxtx] RXTX in FC3/FC4 >To: rxtx at mail.electronpusher.org >Message-ID: <1119689424.12606.14.camel at BPC0276> >Content-Type: text/plain > >Hi all! > >I am trying to get RXTX to work on Fedora Core, version 3 or 4. > >I have tried this with both rxtx 2.0 and 2.1. > >I have tried on two different machines. > >I have tried with java 1.4.2 and java 1.5.0, both from Sun. > >I always get a signall 11 from the native libraries when they are >loaded. ?Is this a common problem? ?Any help is greatly appreciated. >Below is the start of the error message. ?More can be supplied on >demand. > >An unexpected exception has been detected in native code outside the VM. >Unexpected Signal : 11 occurred at PC=0x65015A >Function=(null)+0x65015A >Library=/lib/ld-linux.so.2 > I had thi same problem on SUSE9.3 and java 1.5.0. After searching through the archives, I found a patch that required adding a sleep(1000) command in two functions of SerialIO.java. This only was for rxtx2.1, I had no trouble with rxtx2.0. Note, also I had to add the "|1.5*" sequence to the configure.in file to get good *.so libs. Again 2.0 was fine. -- Allen Byrne adbyrne at ieee.org http://modelrr.adbyrne.us From taj at www.linux.org.uk Fri Jun 3 01:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 08:57:29 +0100 (BST) Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 3 09:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 16:57:53 +0100 (BST) Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi at qbang.org From jasmine at electronpusher.org Fri Jun 3 10:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 17:12:21 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 11:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:02:09 +0100 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 11:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:05:10 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From jon.nall at gmail.com Mon Jun 6 09:13:58 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 10:13:58 -0500 Subject: [Rxtx] StackOverflowError Message-ID: I have a fairly small application that is communicating to a microcontroller programmer at 115.2k. I have a test where I try and dump the memory of the microcontroller (whose size is 8k and change). Things are going smoothly and the data looks good. Then after reading out ~6.5k of data, I get a StackOverflowError. The stack trace looks like: CommInterface.serialEvent(): 324 // this is my code RXTXPort.sendEvent(): 732 RXTXPort.eventLoop() [Native] MonitorThread.run(): 1531 I am running on windows and using rxtx-2.1-CVS-20050120. When I increased the stack size to 512k, I could read the entire chip without issue. But that doesn't seem like the right thing to do without root causing what's happening. My code doesn't include any recursion and the stack trace looks terribly short, so I'm a bit confused as to why I'm getting a StackOverflowError. CommInterface.serialEvent() does little more than grab the available bytes, enter a synchronized block, stick them in a common data area for the main thread to use and leave the synchronization block. I guess my question is: are there any known issues with the default stack size when using the latest rxtx on windows? thanks, nall. From taj at www.linux.org.uk Mon Jun 6 09:27:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 16:27:34 +0100 (BST) Subject: [Rxtx] StackOverflowError In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > I have a fairly small application that is communicating to a > microcontroller programmer at 115.2k. I have a test where I try and > dump the memory of the microcontroller (whose size is 8k and change). > Things are going smoothly and the data looks good. Then after reading > out ~6.5k of data, I get a StackOverflowError. The stack trace looks > like: > > CommInterface.serialEvent(): 324 // this is my code > RXTXPort.sendEvent(): 732 > RXTXPort.eventLoop() [Native] > MonitorThread.run(): 1531 > > I am running on windows and using rxtx-2.1-CVS-20050120. When I > increased the stack size to 512k, I could read the entire chip without > issue. But that doesn't seem like the right thing to do without root > causing what's happening. My code doesn't include any recursion and > the stack trace looks terribly short, so I'm a bit confused as to why > I'm getting a StackOverflowError. > > CommInterface.serialEvent() does little more than grab the available > bytes, enter a synchronized block, stick them in a common data area > for the main thread to use and leave the synchronization block. > > I guess my question is: are there any known issues with the default > stack size when using the latest rxtx on windows? > This is the first I've heard of the problem. It is strange as you mention lookin at the stack trace. That cant be taking up too much space. If you just toss the data instead of trying to put it in your work area, does it persist? -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Mon Jun 6 10:09:39 2005 From: lengyel at gmail.com (FL) Date: Mon, 6 Jun 2005 12:09:39 -0400 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on which the jdk1.5.0_03 is installed. I found that the INSTALL documentation seems to be in error. It states that javacomm20-x86.tar.Z (the Java Communications API for Solaris/x86) must be used, in fact this choice led to the following test with theBlackBox sample program in the commapi: root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG BlackBox -p /dev/ttyS0 Port /dev/ttyS0 not found! No serial ports found! Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to cause Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to the Eclipse stable build version 3.1M7 to avoid this. However, I found that using the Solaris/Sparc version of commapi worked on my system. I have documented this on: http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050606/b28fb9a7/attachment-0003.html From taj at www.linux.org.uk Mon Jun 6 10:30:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:30:27 +0100 (BST) Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, FL wrote: > I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on > which the jdk1.5.0_03 is installed. I found that the INSTALL documentation > seems to be in error. It states that javacomm20-x86.tar.Z (the Java > Communications API for Solaris/x86) must be used, in fact this choice led to > the following test with theBlackBox sample program in the commapi: > > root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG > BlackBox -p /dev/ttyS0 > Port /dev/ttyS0 not found! > No serial ports found! > > Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to > cause > Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to > the Eclipse stable build version 3.1M7 to avoid this. > > However, I found that using the Solaris/Sparc version of commapi > worked on my system. > > I have documented this on: > > http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 > Thanks FL. I'll change the documentation to point to the SPARC comm.jar. In the past, any Solaris was good enough, we tried to avoid the w32 comm.jar because it made native calls rxtx would never implement on any OS as they are not platform neutral. I'll withold comments about Sun's comm.jar being different on various CPUs within even the same OS. RXTX 2.1 does not need to do that even acrossed OSs for instance. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 6 10:35:43 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 11:35:43 -0500 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API Message-ID: It seems that Sun's javax.comm site does not include JavaDoc'ed API and the RxTx site has the API, but no real documentation. Is there some site that i'm just missing in my google searches? I'm looking for a copy of the javax.comm API which is documented. Thanks, nall. From taj at www.linux.org.uk Mon Jun 6 10:44:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:44:03 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > It seems that Sun's javax.comm site does not include JavaDoc'ed API > and the RxTx site has the API, but no real documentation. Is there > some site that i'm just missing in my google searches? I'm looking for > a copy of the javax.comm API which is documented. > > Thanks, > nall. Sun's version is with their binary downloads. RXTX tries to match that so I never bothered with more complete JavaDocs. Whatever Sun documents is what we try to do. -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Mon Jun 6 12:13:44 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 6 Jun 2005 14:13:44 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: Message-ID: <20050606181245.528C929D56F@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Trent Jarvi > Sent: Monday, June 06, 2005 12:44 PM > To: Jon Nall; Java RXTX discussion > Subject: Re: [Rxtx] Where can I find JavaDoc on the javax.comm API > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > It seems that Sun's javax.comm site does not include JavaDoc'ed API > > and the RxTx site has the API, but no real documentation. Is there > > some site that i'm just missing in my google searches? I'm > looking for > > a copy of the javax.comm API which is documented. > > > > Thanks, > > nall. > > Sun's version is with their binary downloads. RXTX tries to > match that so I never bothered with more complete JavaDocs. > Whatever Sun documents is what we try to do. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Try http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht ml -Ack From gadelavega at yahoo.com.ar Mon Jun 6 12:58:09 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Mon, 6 Jun 2005 15:58:09 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606181245.528C929D56F@mail.electronpusher.org> Message-ID: <20050606185809.57069.qmail@web14603.mail.yahoo.com> --- "David S. Acker" escribi?: > > -----Original Message----- > > From: rxtx-bounces at mail.electronpusher.org > > [mailto:rxtx-bounces at mail.electronpusher.org] On > Behalf Of Trent Jarvi > > Sent: Monday, June 06, 2005 12:44 PM > > To: Jon Nall; Java RXTX discussion > > Subject: Re: [Rxtx] Where can I find JavaDoc on > the javax.comm API > > > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > > > It seems that Sun's javax.comm site does not > include JavaDoc'ed API > > > and the RxTx site has the API, but no real > documentation. Is there > > > some site that i'm just missing in my google > searches? I'm > > looking for > > > a copy of the javax.comm API which is > documented. > > > > > > Thanks, > > > nall. > > > > Sun's version is with their binary downloads. > RXTX tries to > > match that so I never bothered with more complete > JavaDocs. > > Whatever Sun documents is what we try to do. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > Try > http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > ml > -Ack > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > I'm prety sure it was there... but not anymore. Gonzalo A. de la Vega, BI ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From taj at www.linux.org.uk Mon Jun 6 18:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 01:09:14 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606185809.57069.qmail@web14603.mail.yahoo.com> References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: >> http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > > I'm prety sure it was there... but not anymore. > It is there. Maybe the URL got mangled. Try this http://tinyurl.com/8dfp7 It just redirects you to: http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.html -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 7 05:46:39 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Jun 2005 07:46:39 -0400 Subject: [Rxtx] rxtx under fedora - odd procedures Message-ID: Hi All, I was able to get RXTX communications to work under Fedora, but only after I added myself to the UUCP and LOCK groups, logged out and then logged back in. Both groups appear to be needed in order to access the serial ports. Also the group alter did not take until after I logged out and logged back in. My theory is that you need permission to write to the var/spool directory under fedora and that this is the only way to do it. Logging out and logging back in just seems like an odd thing to do. I suppose some users may have to restart X. Ouch! Is this true? The alter_group command indicates that you need to be an su to alter the group database. Does this mean that my serial port users need a database su able person to use serial port applications under RXTX? If so, what is the procedure to make a transparent install work using Java web start? Should I be prompting users for the su password? Should I be telling users to exit from X and log out? Is this the way other serial communications programs work? Thanks! - Doug From sean_montgomery at baseview.com Tue Jun 7 08:14:51 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 7 Jun 2005 10:14:51 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: >>> http://java.sun.com/products/javacomm/javadocs/javax/comm/package- >>> summary.ht >>> > > >> >> I'm prety sure it was there... but not anymore. >> >> > > It is there. Maybe the URL got mangled. Try this > > http://tinyurl.com/8dfp7 > > It just redirects you to: > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > summary.html > Maybe the issue here is that the info is available without frames from that URL, but when you try to access it with frames (from the link on that page) it doesn't work - it takes you to: http://java.sun.com/products/javacomm/javadocs/index.html Which doesn't have anything useful on it. From gadelavega at yahoo.com.ar Tue Jun 7 08:22:50 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:22:50 -0300 (ART) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: Message-ID: <20050607142251.92850.qmail@web14626.mail.yahoo.com> --- "Dr. Douglas Lyon" escribi?: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the > group > alter did not take until after I logged out and > logged back in. > > My theory is that you need permission to write to > the var/spool > directory under fedora and that this is the only way > to do it. > > Logging out and logging back in just seems like an > odd thing to > do. I suppose some users may have to restart X. > Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port > applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log > out? > Is this the way other serial communications programs > work? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Actually, you need the lock group to acces /var/lock directory, and uucp to acces /dev/ttyS*. You (as root) shuold add all users you will allow to use the serial ports to group uucp and all the ones you'll allow to lock the ports to lock group (rxtx needs both). This is not only for rxtx, but for any use of the serial ports. Next time they login they'll be able to work, so if they are in they'll have to log out first. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From gadelavega at yahoo.com.ar Tue Jun 7 08:23:56 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:23:56 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> Message-ID: <20050607142356.93815.qmail@web14624.mail.yahoo.com> --- Sean Montgomery escribi?: > > On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: > > >>> > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > >>> summary.ht > >>> > > > > > >> > >> I'm prety sure it was there... but not anymore. > >> > >> > > > > It is there. Maybe the URL got mangled. Try this > > > > http://tinyurl.com/8dfp7 > > > > It just redirects you to: > > > > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > > summary.html > > > > Maybe the issue here is that the info is available > without frames > from that URL, but when you try to access it with > frames (from the > link on that page) it doesn't work - it takes you > to: > > http://java.sun.com/products/javacomm/javadocs/index.html > > Which doesn't have anything useful on it. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > That's right, my bad. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From jon.nall at gmail.com Tue Jun 7 08:33:40 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 09:33:40 -0500 Subject: [Rxtx] performance expectations Message-ID: Hi all. I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC microcontroller. The protocol I'm using (which I didn't create) looks like this for the section of code I'm concerned with: PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data PIC -> PC: 0x01 // ACK 0xNN // First 8 bits of data 0xMM // Second 8 bits of data I issue ~2000 of these Read commands. The PIC itself has an input fifo which can store 18 bytes, so I can have 18 read commands in flight at a given time. The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k 8N1. I am measuring the time it takes to perform these 2000 commands at around 30 seconds, which is much longer than I anticipated. With the link fully utilized, I expected: Time per byte transmitted: 115200 / 8 = 14400 bytes/second = ~70 uS/byte Time per response transmitted: ~70 uS/byte * 3 bytes/response = ~210 uS/response Time for 2000 responses to be transmitted: ~210 uS/response * 2000 responses = ~420ms I'm a bit new to this, so I may have made some bad asumptions, but I would have expected a time of a couple of seconds to perform the 2000 reads, not 30+ seconds. I'm obviously missing something here. Can someone help me understand what's going on? Thanks, nall. From taj at www.linux.org.uk Tue Jun 7 09:17:48 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:17:48 +0100 (BST) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the group > alter did not take until after I logged out and logged back in. > > My theory is that you need permission to write to the var/spool > directory under fedora and that this is the only way to do it. > > Logging out and logging back in just seems like an odd thing to > do. I suppose some users may have to restart X. Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log out? > Is this the way other serial communications programs work? > RIght now, rxtx requires you do one of two things. 1) Use lock files (recommended). This requires intervention by the root users to allow users to create lock files and open the ports as you note. 2) configure rxtx with --disable-lockfiles. In this case you need only worry about the permissions on /dev/ttyS* I'm not sure what the default on Fedora is with respect to permisions. This is not very attractive. There is a better way it could be done on Fedora. Fedora comes with lockdev library. I've been considering this for some time. We could use that for the locking and do away with many of the problems. The problem is embeded devices running Linux do not come with liblockdev. But for your use, I would consider adding a new option for locking serial devices using liblockdev. lockdev-devel has a man page with further information. SYNOPSIS #include pid_t dev_testlock( const char * devname); pid_t dev_lock( const char * devname); pid_t dev_relock( const char * devname, pid_t pid); pid_t dev_unlock( const char * devname, pid_t pid); cc [ flag ... ] file ... -llockdev [ library ] This would probably need to be a configure time option to prevent problems on embeded Linux devices but could otherwise be the default on Linux. I could toss a quick patch together if this is confusing. It is actually easier than what rxtx does now. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 09:27:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:27:11 +0100 (BST) Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > Hi all. > I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC > microcontroller. The protocol I'm using (which I didn't create) looks like this > for the section of code I'm concerned with: > > PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data > PIC -> PC: 0x01 // ACK > 0xNN // First 8 bits of data > 0xMM // Second 8 bits of data > > I issue ~2000 of these Read commands. The PIC itself has an input fifo which > can store 18 bytes, so I can have 18 read commands in flight at a given time. > The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k > 8N1. > > I am measuring the time it takes to perform these 2000 commands at around 30 > seconds, which is much longer than I anticipated. With the link fully utilized, > I expected: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte > > Time per response transmitted: > ~70 uS/byte * 3 bytes/response = ~210 uS/response > > Time for 2000 responses to be transmitted: > ~210 uS/response * 2000 responses = ~420ms > > I'm a bit new to this, so I may have made some bad asumptions, but I would have > expected a time of a couple of seconds to perform the 2000 reads, not 30+ > seconds. > > I'm obviously missing something here. Can someone help me understand what's > going on? > I've hooked rxtx in loopback with a scope in the past at 9600 baud (baud rate is not important). Using event notification and just writing a byte on event/read the latencey was around 8-12 ms. The JNI is not an efficient way to use native code - especially for bit banging. So if timing is critical you want to move some of the logic into the native code rather than banging over the JNI. 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your performance. C# has advantages here. If you move your logic into the native layer or use gcj (rxtx will work with that too) most of your latency should vanish. You may have to play with some sleeps in eventLoop at that point to get full native efficiency. With gcj all of rxtx becomes 'native code' as java is just treated as a subset of C++. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 09:38:51 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 10:38:51 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: On 6/7/05, Jon Nall wrote: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte of course that should be divided by 10 to account for the start/stop bits, but it barely changes the end results. From carobizar at free.fr Tue Jun 7 10:21:29 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 7 Jun 2005 18:21:29 +0200 Subject: [Rxtx] (no subject) Message-ID: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Hello ! I am a french student and I have to create an application able to read and write on serial and parallel port and to run on Windows and Linux. For the moment my program run on Windows thanks the Java Communication API (version for Microsoft Windows and Solaris/x86). But it doesn't work on Linux. Does a recent version of an installation documentation exist ? I didn't find one on the RXTX site (nothing for the windows installation and the linux installation deals with a "jcl.jar" that I don't know...). So, I have some questions : 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 version or Linux&w32 version ?) What are the differences between them ? Which of them are the most stable ? 2) Where have I to put the .so and .dll files ? 3) What have I to write on the file javax.comm.properties ? 4) Have I to delete the file win32comm.dll included in the Java Comm API ? 5) Have I to keep both comm.jar and RXTXcomm.jar ? Best regards, Caroline. From debief at telemsa.com Tue Jun 7 10:44:56 2005 From: debief at telemsa.com (DEBIEF Eric) Date: Tue, 7 Jun 2005 18:44:56 +0200 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: <200506071844.56656.debief@telemsa.com> Hi, We are "pushing" RxTx /Java here in a half-duplex link. The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC and application handling) about 25?s/byte. The figures are the barely the same on two environments. Environment 1 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Linux 2.6.3, Mdk 10.0. RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : bytes are lost on the wire. I need to investigate this mystery.... Java : 1.4.2-rc1 Blackdown Environment 2 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Windows 2000 Pro RxTx : 2.0.7. Java : 1.4.2_08 SUN I Hope this help, Eric. _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 7 11:05:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:05:45 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, DEBIEF Eric wrote: > Hi, > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. How many write() calls is this? > > Environment 1 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Linux 2.6.3, Mdk 10.0. > RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : > bytes are lost on the wire. I need to investigate this mystery.... > Java : 1.4.2-rc1 Blackdown > > Environment 2 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Windows 2000 Pro > RxTx : 2.0.7. > Java : 1.4.2_08 SUN > In my event/read/write test I found windows was ~20% faster than linux for some reason (strange part is Windows was in VMWare on the same Linux machine). It was about the same rxtx version. There are many problems with rxtx 1.4 with respect to commapi on windows but its code paths are more simple. What some people want from rxtx is perhaps better served by hacking up the very first release as they just want to read and write which is what rxtx was before Sun released commapi. It sounds like perhaps you are pushing out larger writes which will greatly improve results. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 11:16:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:16:49 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118161289.42a5c989cf6a2@imp4-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: On Tue, 7 Jun 2005 carobizar at free.fr wrote: > > Hello ! > > I am a french student and I have to create an application able to read and write > on serial and parallel port and to run on Windows and Linux. > For the moment my program run on Windows thanks the Java Communication API > (version for Microsoft Windows and Solaris/x86). > But it doesn't work on Linux. > > Does a recent version of an installation documentation exist ? > I didn't find one on the RXTX site (nothing for the windows installation and the > linux installation deals with a "jcl.jar" that I don't know...). > > So, I have some questions : > > 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 > version or Linux&w32 version ?) What are the differences between them ? Which > of them are the most stable ? > Use rxtx 2.0 with commapi for sparc solaris from Sun. If you want your current package javax.comm. > 2) Where have I to put the .so and .dll files ? On Linux just use the source, the configure script will do all of that for you. tar -xzvf rxtx-2.0-version mkdir rxtx-2.0-version/build cd rxtx-2.0-version/build ../configure && make install It will do everything for you. With Windows, you need to create the javax.comm.properties and install the DLL on your path. But you can just use Sun's package too. They are intended to be interchangable. > > 3) What have I to write on the file javax.comm.properties ? Driver=gnu.io.RXTXCommDriver More documentation in INSTALL that comes with the source. Sun's documentation should work too. configure does this for you on Linux. > > 4) Have I to delete the file win32comm.dll included in the Java Comm API ? > No > 5) Have I to keep both comm.jar and RXTXcomm.jar ? > Yes. RXTX 2.1 replaces comm.jar but the package is different (gnu.io) to avoid contaminating Sun's namespace. With rxtx 2.0 you need Sun's comm.jar - they work together. > > Best regards, > Caroline. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Tue Jun 7 12:07:34 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 14:07:34 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 Message-ID: <20050607180632.1543A29D5C8@mail.electronpusher.org> Hello, I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our product includes a built in USB to Serial adapter so that when it is connected to your PC over USB, it appears as a serial port. We had problems with Sun's comm library because it did not detect serial ports coming and going properly. I did run into a few issues with RxTx though. I am building under Windows (we support XP and 2000) under cygwin. I used a simple make file for the c code that works under cygwin and ant to build the java stuff. Attached is a diff file. The patches hit the following issues: ParallelImp.c - I am not using config so there is no config.h for me. Also, gcc didn't like a local file (win32termios.h) getting included with <> . RXTXPort.java - You can get an exception during the writeByte, writeArray, nativeDrain, readByte, read, readArray, readTerminatedArray, and nativeAvailable calls. Without this patch the IOLocked count gets stuck incremented. termios.c - If you try to open a port through CreateFile and get ERROR_ACCESS_DENIED it means someone else is using the port. We need to make sure to use serial_close instead of just close. I found that some devices finish their I/O synchronously. The code was treating this as an error. I also added some checking on the ClearError calls. I found a compile error when debugging is turned on (see the usleep change). SerialImp.c - Again, I don't have a config.h and again we must use quotes and not <> to include win32termios.h . I also commented out a report call since it seems to happen constantly on my system. Feel free to use these in any way that you want or just to ignore them. Thanks! -Dave Acker dacker at nomadio.net Software Engineer Nomadio, Inc. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diffs.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/5671d159/diffs-0003.txt From jon.nall at gmail.com Tue Jun 7 12:28:16 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 13:28:16 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, DEBIEF Eric wrote: > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. Hi. This is helpful, thanks. I can think of 2 reasons I'm not collecting the data as fast as I think I should be: 1) the device to PC connection is not at 100% utilization 2) my SerialPortEventListener processing has too much overhead Are there other explanations I might be missing as to why it takes so long to transfer the data? Thanks. nall. From taj at www.linux.org.uk Tue Jun 7 13:21:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:21:46 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > On 6/7/05, DEBIEF Eric wrote: > > We are "pushing" RxTx /Java here in a half-duplex link. > > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > > and application handling) about 25?s/byte. > > The figures are the barely the same on two environments. > > Hi. > This is helpful, thanks. I can think of 2 reasons I'm not collecting > the data as fast as I think I should be: > 1) the device to PC connection is not at 100% utilization > 2) my SerialPortEventListener processing has too much overhead > > Are there other explanations I might be missing as to why it takes so > long to transfer the data? > Polling the port would probably make more sense. You can set the threshold/timeouts to avoid racing and not deal with the event notification. As mentioned earlier I think the event latency is ~10ms. Keep the event listener around, rxtx 2.* does not close well without it. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 13:27:27 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 14:27:27 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, Trent Jarvi wrote: > Polling the port would probably make more sense. You can set the > threshold/timeouts to avoid racing and not deal with the event > notification. As mentioned earlier I think the event latency is ~10ms. Trent, Thanks for the response. Just to make sure I understand what you're talking about, when you say event latency, do you mean the time it takes from when the byte hits the PC's comm port to when rxtx presents it to user code? So if the link is 100% utilized, will my user code see "hiccups" or a steady stream of data? Thanks for helping a serial port newbie. nall. From dacker at nomadio.net Tue Jun 7 13:32:20 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 15:32:20 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <20050607193118.5499329CAA0@mail.electronpusher.org> Some folks asked about the make file and ant steps. I have JAVA_HOME set as follows: $ echo $JAVA_HOME C:\Program Files\Java\jdk1.5.0_01 I have all the code in rxtx/src put into gnu/io . The make file here doesn't have optimizations turned on. We have not tested with it yet. --------------Begin Makefile------------------ CPPFLAGS="-I$(JAVA_HOME)/include" "-I$(JAVA_HOME)/include/win32" SOBJECTS=SerialImp.o fuserImp.o termios.o fixup.o init.o POBJECTS=ParallelImp.o termios.o init.o DLLS=rxtxParallel.dll rxtxSerial.dll all: $(CLASSES) $(DLLS) rxtxSerial.dll: $(SOBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(SOBJECTS) rxtxParallel.dll: $(POBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(POBJECTS) clean: rm -fv $(SOBJECTS) $(POBJECTS) $(DLLS) %.o: %.c gcc -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< %.o: %.cpp g++ -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< --------------End Makefile------------------ Here is the ant target I use to build the rxtx libs. Our build puts the class files in a bin dir. We copy the dlls to a deploy dir and to the build dir. Eclipse seems to like the dlls in the build dir. The deploy dir is used when we build our full package. --------------Begin Ant Section------------------ --------------End Ant Section------------------ > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > David S. Acker > Sent: Tuesday, June 07, 2005 2:08 PM > To: 'Java RXTX discussion' > Subject: [Rxtx] Patches to 2.1-7pre17 > > Hello, > I am using RxTx with the Nomadio Sensor, > http://www.nomadio.net/ . Our product includes a built in > USB to Serial adapter so that when it is connected to your PC > over USB, it appears as a serial port. We had problems with > Sun's comm library because it did not detect serial ports > coming and going properly. > > I did run into a few issues with RxTx though. I am building > under Windows (we support XP and 2000) under cygwin. I used > a simple make file for the c code that works under cygwin and > ant to build the java stuff. Attached is a diff file. The > patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h > for me. Also, gcc didn't like a local file (win32termios.h) > getting included with <> . > > RXTXPort.java - You can get an exception during the > writeByte, writeArray, nativeDrain, readByte, read, > readArray, readTerminatedArray, and nativeAvailable calls. > Without this patch the IOLocked count gets stuck incremented. > > termios.c - If you try to open a port through CreateFile and > get ERROR_ACCESS_DENIED it means someone else is using the > port. We need to make sure to use serial_close instead of > just close. I found that some devices finish their I/O > synchronously. The code was treating this as an error. I > also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we > must use quotes and not <> to include win32termios.h . I > also commented out a report call since it seems to happen > constantly on my system. > > Feel free to use these in any way that you want or just to > ignore them. > Thanks! > > -Dave Acker > dacker at nomadio.net > Software Engineer > Nomadio, Inc. > From taj at www.linux.org.uk Tue Jun 7 13:37:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:37:45 +0100 (BST) Subject: [Rxtx] Re: Stack Smashing Attack In-Reply-To: <200506072012.48860.ferdinand.tatzig@web.de> References: <200506072012.48860.ferdinand.tatzig@web.de> Message-ID: On Tue, 7 Jun 2005, Ferdinand Tatzig wrote: > Dear Trent > > I am using RXTX for serial port communication between a PC and a payment > transaction terminal. > When I run my application under Windows 2000, an i386-Linux or an i386-FreeBSD > it works as I expect it to do. However, when I start it to run on AMD64 > machine with a 64-bit Gentoo Linux, the VM terminates with the following > error: > > Port found: /dev/ttyS0 > java: stack smashing attack in function configure_port() > > I am using a 64-bit Blackdown-1.4.2-01 VM. > > I have searched the internet but have found no information about this error. > > This is the code of the method which initializes the serial port: > > /** > * initializes a serial port for communication with a terminal; only > * accessible within this class > * > * @param communication > * @param serialPortToBeInitialized > * @param tillInterfaceEventListener > */ > private TillInterfaceSerialPort(Communication communication, > String serialPortToBeInitialized, > TillInterfaceEventListener tillInterfaceEventListener) > throws IOException, PortInUseException, > TillInterfaceSerialPortNotFoundException, > TooManyListenersException, UnsupportedCommOperationException { > serialPortName = "not initialized yet"; > CommPortIdentifier portId = null; > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > boolean portFound = false; > String temporarySerialPortName = "not initialized yet"; > > // look for a serial port > while (portList.hasMoreElements() && !portFound) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > temporarySerialPortName = portId.getName(); > if (temporarySerialPortName.equals(serialPortToBeInitialized)) { > System.out.print("Port found: "); > System.out.println(temporarySerialPortName); > serialPortName = temporarySerialPortName; > portFound = true; > } > } > } > if (portFound) { > > // initialize the found port - this command causes the VM to terminate > serialPort = (SerialPort) portId > .open( > TillInterfaceConstants.APPLICATION_NAME, > TillInterfaceConstants > .TIMEOUT_IN_MILLISECONDS_FOR_OPENING_OF_COMMUNICATION_PORT); > > // add an event listener which listens > // on the serial port and notifies the > // serial port object when input bytes > // have been received at the port > serialPort.addEventListener(tillInterfaceEventListener); > serialPort.notifyOnDataAvailable(true); > > // initialize the physical layer > // parameters of the serial port > serialPort.setSerialPortParams(TillInterfaceConstants.BAUD_RATE, > SerialPort.DATABITS_8, SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > // set the inter-character > // timeout (T2) > serialPort > .enableReceiveTimeout(TillInterfaceConstants.INTERCHARACTER_TIMEOUT_IN_MILLISECONDS); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > } else > throw new TillInterfaceSerialPortNotFoundException(); > } > > Any hint to solve this problem would be kindly appreciated. > The only thing that comes to mind here after looking at the offending function is rxtx used to include asm/termios.h but now we moved to termios.h and had glibc fix their headers. The asm/termios.h caused problems as its termios was smaller than the actual termios. This should be fixed in current rxtx versions but you can just glance at SerialImp.c and make sure it does not include asm/termios.h. I've cc'd the rxtx mail list because there was one other mention of stack problems recently. I have used rxtx on opteron systems with success. I have a bug I'm trying hard to reproduce on suse 64 bit (circa linux 2.4.19) systems though. So far I have not been able to reproduce the bug. That said, with gentoo... I like gentoo but I seriously doubt they do any QA with their kernel and Java. I've seen problems before. If you use gentoo and have Java problems, at least stick to Linus (that is an s there) kernels while using Java. I'm not an expert on gentoo but I've seen patches go into experimental kernels that turn out to break java and are reverted before going to Linus just before I see problems with gentoo on this list. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:16:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:16:14 +0100 (BST) Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: On Tue, 7 Jun 2005, David S. Acker wrote: > Hello, > I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our > product includes a built in USB to Serial adapter so that when it is > connected to your PC over USB, it appears as a serial port. We had problems > with Sun's comm library because it did not detect serial ports coming and > going properly. > > I did run into a few issues with RxTx though. I am building under Windows > (we support XP and 2000) under cygwin. I used a simple make file for the c > code that works under cygwin and ant to build the java stuff. Attached is a > diff file. The patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h for me. Also, > gcc didn't like a local file (win32termios.h) getting included with <> . > > RXTXPort.java - You can get an exception during the writeByte, writeArray, > nativeDrain, readByte, read, readArray, readTerminatedArray, and > nativeAvailable calls. Without this patch the IOLocked count gets stuck > incremented. > > termios.c - If you try to open a port through CreateFile and get > ERROR_ACCESS_DENIED it means someone else is using the port. We need to > make sure to use serial_close instead of just close. I found that some > devices finish their I/O synchronously. The code was treating this as an > error. I also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we must use quotes > and not <> to include win32termios.h . I also commented out a report call > since it seems to happen constantly on my system. > > Feel free to use these in any way that you want or just to ignore them. > Thanks! > Hi Dave These patches look great as is. Thanks. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:33:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:33:16 +0100 (BST) Subject: [Rxtx] Patch to IOLocked (fwd) Message-ID: This appears to be another solution to the locking. Chris, the other option just moves the locking into the finally clause which I think would be a little cleaner though I'm posting this patch to so people can comment. -- Trent Jarvi tjarvi at qbang.org ---------- Forwarded message ---------- Date: Wed, 1 Jun 2005 13:01:32 +0100 From: Christopher Dawes To: taj at www.linux.org.uk Subject: Patch to IOLocked Do you want me to check it out of CVS and then submit changes? Christopher -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXPort.java.diff Type: application/octet-stream Size: 6965 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/c442f9fc/RXTXPort.java-0003.obj From Christopher.Dawes at retail-logic.com Wed Jun 8 00:57:24 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 8 Jun 2005 07:57:24 +0100 Subject: [Rxtx] Patch to IOLocked (fwd) [Virus Checked] In-Reply-To: Message-ID: Agreed, much better Java :-) Thanks Christopher ------------------------------------------- Consultant Engineer Retail Logic Limited Fleet GU51 3TZ Tel: +44 (0)1252 644377 Mob: +44 (0)7899 842759 Fax: +44 (0)1252 776708 rxtx-bounces at mail.electronpusher.org wrote on 07/06/2005 21:33:16: > > This appears to be another solution to the locking. Chris, the other > option just moves the locking into the finally clause which I think would > be a little cleaner though I'm posting this patch to so people can > comment. > > -- > Trent Jarvi > tjarvi at qbang.org > > ---------- Forwarded message ---------- > Date: Wed, 1 Jun 2005 13:01:32 +0100 > From: Christopher Dawes > To: taj at www.linux.org.uk > Subject: Patch to IOLocked > > Do you want me to check it out of CVS and then submit changes? > > Christopher[attachment "RXTXPort.java.diff" deleted by Chris > Dawes/Retaillogic/NISABA] _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx From zempftman at gmail.com Wed Jun 8 07:57:25 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 09:57:25 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Maxwell Zempftman Date: May 27, 2005 5:01 PM Subject: Re: [Rxtx] Kaffe & rxtx & armv5b To: rxtx at mail.linuxgrrls.org Here are the results from working this week: The "NullPointerExceptions" are generated by the software when I choose a bad device file. I discovered that this occurs on the i686-RedHat box as well. This exception seems to be generated only by this particular application, and not by the example programs in contrib. So, for example: java MyApp /dev/null <-- generates NullPointerException java MyApp fake <-- generates NullPointerException java MyApp /dev/ttyS0 <-- does not generate NullPointerException Using the program CommCheck (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it appears as though /dev/ttyS0 is the only valid serial device file on the XScale device, so the errors I was getting are not really be bugs. Although /dev/ttyS0 did not generate NullPointerExceptions, I did encounter this error: --start java MyApp /dev/ttyS0 (going mostly from memory, not exact) PortList.hasMoreElements: true Listening on: /dev/ttyS0 Client connected. >From net: echo kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 vmExcept_setJNIFrame Assert: on 'fp != 0' failed. --end I took a look at exception.h, and it seems as though the problematic code does not exist in newer versions of Kaffe (I have been using CVS-2004-11). Next week I will try to use a newer version, although so far everything but CVS-2004-11 has failed. Also, I the device files I need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with something like this? Thanks, Max. > On 5/21/05, Trent Jarvi wrote: > > I'm not sure what is wrong in the first part. It sounds like your > > application may be swallowing an exception while trying to enumerate the > > port or open it. The usual mistake made it not having permissions to > > either open the port or create the lockfile. There should be examples in > > the contrib directory you can try that enumerate and open ports. Maybe > > that will give you some hints. > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > Sun's code limiting you there though you do need to compile and install > > rxtx for the XScale with Sun's Commapi. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > From taj at www.linux.org.uk Wed Jun 8 08:22:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 15:22:44 +0100 (BST) Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > ---------- Forwarded message ---------- > From: Maxwell Zempftman > Date: May 27, 2005 5:01 PM > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > To: rxtx at mail.linuxgrrls.org > > > Here are the results from working this week: > > The "NullPointerExceptions" are generated by the software when I > choose a bad device file. I discovered that this occurs on the > i686-RedHat box as well. This exception seems to be generated only by > this particular application, and not by the example programs in > contrib. So, for example: > > java MyApp /dev/null <-- generates NullPointerException > java MyApp fake <-- generates NullPointerException > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > Using the program CommCheck > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > appears as though /dev/ttyS0 is the only valid serial device file on > the XScale device, so the errors I was getting are not really be bugs. > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > encounter this error: > > --start > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > PortList.hasMoreElements: true > Listening on: /dev/ttyS0 > Client connected. > >From net: echo > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > --end > > I took a look at exception.h, and it seems as though the problematic > code does not exist in newer versions of Kaffe (I have been using > CVS-2004-11). Next week I will try to use a newer version, although so > far everything but CVS-2004-11 has failed. Also, I the device files I > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > something like this? > In RXTXCommDriver, just look for the following code and add /dev/ttyM to the list. Moxa? if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } So: if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyM", // for Moxa ports "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } Linux just has way too many port types to try enumerating them all. There is potential we can add them back in with udev now. > Thanks, > Max. > > > On 5/21/05, Trent Jarvi wrote: > > > I'm not sure what is wrong in the first part. It sounds like your > > > application may be swallowing an exception while trying to enumerate the > > > port or open it. The usual mistake made it not having permissions to > > > either open the port or create the lockfile. There should be examples in > > > the contrib directory you can try that enumerate and open ports. Maybe > > > that will give you some hints. > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > Sun's code limiting you there though you do need to compile and install > > > rxtx for the XScale with Sun's Commapi. > > > > > > -- > > > Trent Jarvi > > > tjarvi at qbang.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Wed Jun 8 12:16:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 08 Jun 2005 13:16:03 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A60B8D.8080500@cs.umn.edu> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> Message-ID: <42A735E3.8040706@atcorp.com> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual serial comport. This isn't so much of a problem, what is, however, is that the comport does not appear to be able to be set to any arbitrary speed, only those from the data_rate enum. I've not found much on using different speeds, has anyone else encountered anything similar? I greatly appreciate any and all comments and suggestions. Thanks in advance, ~ Shawn Lavelle From zempftman at gmail.com Wed Jun 8 12:50:58 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 14:50:58 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: Thanks Trent! That will solve one of the problems. I don't know when my next chance to work on it will be, but I still need to figure out the error I got when I tried opening '/dev/ttyS0' on the Moxa device regarding a failed assertion, seemed to be a Kaffe issue. Thanks for you help, hope to have results soon, Max Englander. On 6/8/05, Trent Jarvi wrote: > On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > > > ---------- Forwarded message ---------- > > From: Maxwell Zempftman > > Date: May 27, 2005 5:01 PM > > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > > To: rxtx at mail.linuxgrrls.org > > > > > > Here are the results from working this week: > > > > The "NullPointerExceptions" are generated by the software when I > > choose a bad device file. I discovered that this occurs on the > > i686-RedHat box as well. This exception seems to be generated only by > > this particular application, and not by the example programs in > > contrib. So, for example: > > > > java MyApp /dev/null <-- generates NullPointerException > > java MyApp fake <-- generates NullPointerException > > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > > > Using the program CommCheck > > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > > appears as though /dev/ttyS0 is the only valid serial device file on > > the XScale device, so the errors I was getting are not really be bugs. > > > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > > encounter this error: > > > > --start > > > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > > > PortList.hasMoreElements: true > > Listening on: /dev/ttyS0 > > Client connected. > > >From net: echo > > > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > > > --end > > > > I took a look at exception.h, and it seems as though the problematic > > code does not exist in newer versions of Kaffe (I have been using > > CVS-2004-11). Next week I will try to use a newer version, although so > > far everything but CVS-2004-11 has failed. Also, I the device files I > > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > > something like this? > > > > > In RXTXCommDriver, just look for the following code and add /dev/ttyM to > the list. Moxa? > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > So: > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyM", // for Moxa ports > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > Linux just has way too many port types to try enumerating them all. There > is potential we can add them back in with udev now. > > > > > Thanks, > > Max. > > > > > On 5/21/05, Trent Jarvi wrote: > > > > I'm not sure what is wrong in the first part. It sounds like your > > > > application may be swallowing an exception while trying to enumerate the > > > > port or open it. The usual mistake made it not having permissions to > > > > either open the port or create the lockfile. There should be examples in > > > > the contrib directory you can try that enumerate and open ports. Maybe > > > > that will give you some hints. > > > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > > Sun's code limiting you there though you do need to compile and install > > > > rxtx for the XScale with Sun's Commapi. > > > > > > > > -- > > > > Trent Jarvi > > > > tjarvi at qbang.org > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- > Trent Jarvi > tjarvi at qbang.org > From taj at www.linux.org.uk Wed Jun 8 12:53:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 19:53:10 +0100 (BST) Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A735E3.8040706@atcorp.com> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: On Wed, 8 Jun 2005, Shawn Lavelle wrote: > Hello, > I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate > with a virtual serial comport. This isn't so much of a problem, what > is, however, is that the comport does not appear to be able to be set to > any arbitrary speed, only those from the data_rate enum. I've not found > much on using different speeds, has anyone else encountered anything > similar? I greatly appreciate any and all comments and suggestions. > This problem is a bit more tricky than it should be. POSIX systems just have a few specified baud rates. Solaris is one of these systems. CommAPI baud rates probably came from someone looking at Solaris. RXTX tries to be POSIX like. W32 is treated as a POSIX like system via a termios.c file in rxtx. Serial ports have baudbase and divisor. So you can set these to come close to the baudrate you want. Some funky equipment like automobile test equipment use baud rates that are not really possible with PC hardware. But if you get as close as possible by changing baud base and divisor, it works. Windows can actually do this for you. I don't know exactly what their code does but if you pass a baudrate to windows, it will guestimate a baudbase and divisor. So you just pass it 10200 baud and it does its job. This is not of very much use the way rxtx does things though. Linux has the standard POSIX like baud rates but if you set the baud rate to B38400, you can set your own baud base and divisor. This is not POSIX that I know of. W32 has more capability than POSIX like systems too. So I did some work to have windows work like Linux via termios.c But the code is not quit right. SerialImp.c and termios.c need some work so all the various buadrates work on Linux and W32. Most other systems will not work beyond what CommAPI already specifies without writting kernel drivers. This is on my todo list but if someone gets to it first, all the better. -- Trent Jarvi tjarvi at qbang.org From carobizar at free.fr Thu Jun 9 06:39:10 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Thu, 9 Jun 2005 14:39:10 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: <1118320750.42a8386e6d3ce@imp5-q.free.fr> Hi ! Thank you for all your advices. I managed to use rxtx on Windows but I have still some difficulties on Linux. I have yet follow your instructions and the configure file has created : - librxtxSerial.so and librxtxParallel.so in the directory /usr/java/j2sdk1.4.2_08/jre/lib/i386 - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the directory /usr/java/j2sdk1.4.2_08/jre/lib - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext But when I run my program, Some exceptions occur : Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver So, 1) What have I forgotten ? 2) Is it possible to make my application run on Linux without the jdk (only the jre) ? Best regards, Caroline. From taj at www.linux.org.uk Thu Jun 9 07:28:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 9 Jun 2005 14:28:05 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118320750.42a8386e6d3ce@imp5-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: On Thu, 9 Jun 2005 carobizar at free.fr wrote: > Hi ! > Thank you for all your advices. > I managed to use rxtx on Windows but I have still some difficulties on Linux. > I have yet follow your instructions and the configure file has created : > - librxtxSerial.so and librxtxParallel.so in the directory > /usr/java/j2sdk1.4.2_08/jre/lib/i386 > - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the > directory /usr/java/j2sdk1.4.2_08/jre/lib > - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext > > But when I run my program, Some exceptions occur : > Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while > loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > com.sun.comm.SolarisDriver > > So, > 1) What have I forgotten ? > The native (.so) libraries are not installed in a directory the JRE is looking for native libraries in. You may look around and see where the .so libraries are in the JRE. I don't know that the jre/lib/i386 directory is specified as a required directory for JREs. I noticed some do not use it. You may try printing the java.libarary.path to see your options. It is also possible to alter the java.library.path. > 2) Is it possible to make my application run on Linux without the jdk (only the > jre) ? Yes. Though installation from source with the JDK is less error prone. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0003.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 7 15:03:09 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 07 Jun 2005 16:03:09 -0500 Subject: [Rxtx] Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <42A60B8D.8080500@cs.umn.edu> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual comport. This isn't so much of a problem, what is, however, is that the comport is only ever set to 9600 baud. I've not found this as a documented bug, has anyone else encountered anything similar? I'll try and provide more detail tomorrow, but if anyone has any suggestions or encountered this before, I'd like to hear about it. Thanks in advance, ~ Shawn Lavelle From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0003.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0003.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0003.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Mon Jun 20 01:04:40 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 20 Jun 2005 08:04:40 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: <42B66A88.4060806@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050620/9be208a1/attachment-0003.html From fbalzarro at libero.it Mon Jun 20 02:33:52 2005 From: fbalzarro at libero.it (Fabio Balzarro) Date: Mon, 20 Jun 2005 10:33:52 +0200 Subject: [Rxtx] RXTXPort:close detected bad file descriptor Message-ID: I'm using RXTX libraries on IPAQ 4150 PDA with Windows CE 4.20 and Jeode. When I close a serial port with sp.close() (where sp is a SerialPort) sometimes an error occour 1119256168085: RXTXPort:close detected bad file descriptor What can I do? Thanks Fabio ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From slavelle at atcorp.com Mon Jun 20 08:08:19 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 20 Jun 2005 09:08:19 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: <42B6CDD3.4040409@atcorp.com> It turns out that I did have a driver-not-used issue which has now been resolved and I can use RxTx on it (had to add ttyUSB as a valid port), but only at standard baud rates. Does USB have the same restrictions on port speed as regular RS232? ~ Shawn Trent Jarvi wrote: > Just a note here. > > I have requested a FTDI usb device and they offered to send one for the > purpose of trying to get rxtx working. I have no idea how long that takes > though. > > > On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > > >>I'm afraid we're just using the latest version from the FTDI website. I've >>not yet played with linux properly with this and unfortunately I run gentoo >>and haven't yet successfully compiled in the ftdi driver. I'll let you know >>if I get any success. >> >>Appologies >> >>Christopher >> >>-----Original Message----- >>From: rxtx-bounces at mail.electronpusher.org >>[mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle >>Sent: 15 June 2005 00:00 >>To: Java RXTX discussion >>Subject: Re: [Rxtx] Virtual Com Ports >> >>Hmm, the latter sounds like a lot of work. It does find the virtual comport >>in windows, i must have just missed it earlier (sign of a long day). On the >>linux side, I suspect that something is not correct with the driver >>installation becuase it does not give me a tty for it :( >> >>Christopher, May I ask what driver you are using for your FTDI chip? >>Did you ever encounter problems with not getting a tty assigned for it? >> >> >> Thanks for all your help! >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>They will have to show up as a tty device in Linux. Probably ttyUSB? >>>That will need an entry in RXTXCommDriver.java. If they dont show up >>>as a tty device, rxtx cant treat it like a serial port. It just wont >> >>work. >> >>>With COM3, rxtx will try to open the port and perform a timed out read. >>>Usually if a port is not there, the read blows up or the open blows up. >>>Timing out is fine. COM3 used to share interrupts with COM1. I know >>>you can reassign ports in XP. RXTX scans up through COM255. You may >>>try moving it. >>> >>> >>>The code in question is the following in RXTXCommDriver.java >>> >>> >>> if(osName.equals("Linux")) >>> { >>> String[] Temp = { >>> "ttyS", // linux Serial Ports >>> "ttySA", // for the IPAQs >>> "ttyUSB" // for USB frobs >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>> else if(osName.toLowerCase().indexOf("windows") != -1 ) >>> { >>> String[] Temp = { >>> "COM" // win32 serial ports >>> //"//./COM" // win32 serial ports >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>>If COM3 can be read, it should be found. the ttyUSB should work if >>>thats in the version of RXTXCommDriver.java you have. >>> >>>If this is still a problem, it may be that the driver is erroring on >>>what may be considered normal comm port operations such as setting the >>>speed, timeout, threshold, .. One would have to start looking at each >>>function called in the native open() and read(). >>> >>> >>> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>>seems to find the device using rxtx. Looking at the hardware >>>>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>>>linux. I can't seem to get it to show up as a tty(s#) in linux which >>>>is probably just due to my lack of significant linux knowledge. >>>> >>>> ~ Shawn >>>> >>>>Trent Jarvi wrote: >>>> >>>> >>>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>Has anyone here noticed that virtual comports do not get enumerated >>>>>>via CommPortIdentifier.getPortIdentifiers()?? >>>>>> >>>>>>The device I'm trying to talk to uses an fdti usb to serial >>>>>>convertor with a driver that has it show up as a virtual comport. I >>>>>>can enter this port manually and it will be usable but I cannot get >>>>>>it show up automatically (as in the simple serial demo). Any thoughts >> >>on this? >> >>>>> >>>>>Hi Shawn, >>>>> >>>>>What OS is this and what is the name of the virtual port you are >>>>>trying to open? I suspect the name just needs to be added to >> >>RXTXCommDriver.java. >> >>>>_______________________________________________ >>>>Rxtx mailing list >>>>Rxtx at mail.electronpusher.org >>>>http://www.electronpusher.org/mailman/listinfo/rxtx >>>> >>> >>> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From lyon at docjava.com Mon Jun 20 15:06:08 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 20 Jun 2005 17:06:08 -0400 Subject: [Rxtx] testing Message-ID: Hi All, I am testing my new multi-platform Java Webstart RXTX application (Trent: I could not have done it without you!). So far, I think it will work under Linux (x86), Windows XP, Windows 2000 and MacOS X. The application is available as a Java webstart application at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Edit:Preferences: SerialPort Setup... should bring up a dialog box that enables dialing via the modem. Generally, it does not find internal modems (except on the mac). Why, I don't know. Thanks in advance for trying this new app. All feedback on it is welcome. - Doug Lyon From jasmine at electronpusher.org Tue Jun 21 04:15:53 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Tue, 21 Jun 2005 11:15:53 +0100 Subject: [Rxtx] testing In-Reply-To: References: Message-ID: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > Hi All, > I am testing my new multi-platform Java Webstart RXTX application > (Trent: I could not have done it without you!). > > So far, I think it will work under Linux (x86), Windows XP, > Windows 2000 and MacOS X. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. -J. From taj at www.linux.org.uk Tue Jun 21 05:50:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 12:50:23 +0100 (BST) Subject: [Rxtx] testing In-Reply-To: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> References: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> Message-ID: On Tue, 21 Jun 2005, Jasmine Strong wrote: > > On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > > > Hi All, > > I am testing my new multi-platform Java Webstart RXTX application > > (Trent: I could not have done it without you!). > > > > So far, I think it will work under Linux (x86), Windows XP, > > Windows 2000 and MacOS X. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > on my Mac. > passing -source 1.3 -target 1.3 to javac will compile classes without this problem. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 10:19:25 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 11:19:25 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. Sincerely, Jeremyah Payne From ricardo.trindade at emation.pt Tue Jun 21 13:25:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 20:25:00 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B8698C.2060509@emation.pt> Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > From taj at www.linux.org.uk Tue Jun 21 13:39:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:39:43 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <42B8698C.2060509@emation.pt> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> <42B8698C.2060509@emation.pt> Message-ID: It looks like he has an rs422 device/converter. This is not the problematic 'trying to do protocol X with a serial port' situation unless I'm missing something. I'll follow up with the other email I started. On Tue, 21 Jun 2005, Ricardo Trindade wrote: > Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. > > Payne, Jeremyah L (N-CIM) wrote: > > >Good morning, my name is Jeremyah and I am working on a java project to > >interface with some devices. In short, I have a laptop with a PCMIA > >converter that does RS422 running windows 2000. I also will be > >installing some PCI cards into some Linux boxes that will have probably > >4-8 RS422 ports on them. After doing some reading in order to talk > >with these items using my existing java code I will need an additional > >driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > >trying to get a map sort of where I need to make changes. As I see it, > >I would need to subclass SerialPort to my RS422 interface. That would > >link with a DLL or SO implementation that talks with the hardware. I > >also need to change the listing of working ports in the lookup section > >for serial. Does this seem like I am on the right track? Appreciate > >the support. > > > > > >Sincerely, > >Jeremyah Payne > >_______________________________________________ > >Rxtx mailing list > >Rxtx at mail.electronpusher.org > >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 21 13:40:25 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:40:25 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: On Tue, 21 Jun 2005, Payne, Jeremyah L (N-CIM) wrote: > Good morning, my name is Jeremyah and I am working on a java project to > interface with some devices. In short, I have a laptop with a PCMIA > converter that does RS422 running windows 2000. I also will be > installing some PCI cards into some Linux boxes that will have probably > 4-8 RS422 ports on them. After doing some reading in order to talk with > these items using my existing java code I will need an additional > driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > trying to get a map sort of where I need to make changes. As I see it, I > would need to subclass SerialPort to my RS422 interface. That would link > with a DLL or SO implementation that talks with the hardware. I also > need to change the listing of working ports in the lookup section for > serial. Does this seem like I am on the right track? Appreciate the > support. > Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 13:40:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 14:40:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618954@emss02m08.us.lmco.com> I'd like to except I am dealing with NASA. I am basically building a system to monitor 100+ Units that communicate over RS422. They have some converters in place but want to get rid of them. I'll check through the archives. I had started looking yesterday as was leaving work. -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Ricardo Trindade Sent: Tuesday, June 21, 2005 2:25 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From slavelle at atcorp.com Tue Jun 21 14:58:06 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 21 Jun 2005 15:58:06 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: <42B87F5E.4000403@atcorp.com> > Linux has the standard POSIX like baud rates but if you set the baud rate > to B38400, you can set your own baud base and divisor. This is not POSIX > that I know of. W32 has more capability than POSIX like systems too. So > I did some work to have windows work like Linux via termios.c > > But the code is not quit right. SerialImp.c and termios.c need some > work so all the various buadrates work on Linux and W32. Most other > systems will not work beyond what CommAPI already specifies without > writting kernel drivers. > > This is on my todo list but if someone gets to it first, all the better. Hmm, I guess I didn't read this close enough before. Just to be clear, the pieces to setBaudBase and setDivisor are not yet implemented, correct? Thanks, Shawn From sean_montgomery at baseview.com Tue Jun 21 15:14:08 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 21 Jun 2005 17:14:08 -0400 Subject: [Rxtx] OS X installation - file locations Message-ID: <8AB82C7F-0D19-45F9-AE54-A12C59A8495E@baseview.com> Greetings, I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) using the RXTX installation instructions. RXTX worked fine. Basically you've got: - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions - javax.comm.properties in /System/Library/Frameworks/ JavaVM.framework/Home/lib - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ lib/ext My coworker was concerned that the installation required files to be placed in /System/Library... because those directories are "Apple's" and subject to change at Apple's whim, and that it would be safer (less likely to break when a user updates their OS or Java version or what have you) if all the files could be somewhere in /Library... or / Library/Java. My coworker points out that when 3rd party apps like FrontBase and JBoss need to communicate with Java their jars are placed in /Library/Java/Extensions. Granted that RXTX 2.0 is implementing javax.comm and not just a 3rd party extension, might that be the case - that javax.* stuff needs to be in the Java system files? I'm not the Java maven that my coworker is, so I don't know if any of this is gospel or not. Any OS X/Java experts out there willing to comment? We'd like to be able to install RXTX in the safest, most maintenance free way possible, but if there are specific reasons why javax.comm.properties and comm.jar need to be in /System... then so be it. Any information is welcome, Sean From ricardo.trindade at emation.pt Tue Jun 21 15:56:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 22:56:53 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B88D25.7060604@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050621/f6c9f5fe/attachment-0003.html From jeremyah.l.payne at lmco.com Tue Jun 21 15:22:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 16:22:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618955@emss02m08.us.lmco.com> -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Trent Jarvi Sent: Tuesday, June 21, 2005 2:40 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 As of yet we have not decided on the PCI boards to use yet So I am still waiting to se how we will interface to them. But the laptop is ready to use so ill build a test app for that API for now. The overview of class structure is really what I needed. I guess I will use the 2.1 as you suggested. Thanks for the help thus far! BTW, you guys wouldn't happen to keep class diagrams or anything of that nature around would you? If not I will probably end up having to do some anyway for documentation purposes, I could include them. Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From dmarkman at mac.com Tue Jun 21 18:13:28 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 21 Jun 2005 20:13:28 -0400 Subject: [Rxtx] OS X installation - file locations In-Reply-To: References: Message-ID: <044F520C-585C-4B99-82ED-3BA83DB8CE77@mac.com> Apple doesn't recommend to put jars into the /System/Library/Frameworks/JavaVM.framework/Home/lib/ext folder from other hands it's standard java directory to put extentions if you want to support comm api on whole system then I'd recommend to put jars into the /Library/Java/Extensions folder just like you did if you want to support comm api per user put your jars into the ~/ Library/Java/Extensions On Jun 21, 2005, at 5:14 PM, Java RXTX discussion wrote: > Greetings, > > > I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) > using the RXTX installation instructions. RXTX worked fine. > > > Basically you've got: > - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions > - javax.comm.properties in /System/Library/Frameworks/ > JavaVM.framework/Home/lib > - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ > lib/ext > > > My coworker was concerned that the installation required files to be > placed in /System/Library... because those directories are "Apple's" > and subject to change at Apple's whim, and that it would be safer > (less likely to break when a user updates their OS or Java version or > what have you) if all the files could be somewhere in /Library... or / > Library/Java. My coworker points out that when 3rd party apps like > FrontBase and JBoss need to communicate with Java their jars are > placed in /Library/Java/Extensions. Granted that RXTX 2.0 is > implementing javax.comm and not just a 3rd party extension, might > that be the case - that javax.* stuff needs to be in the Java system > files? > > > I'm not the Java maven that my coworker is, so I don't know if any of > this is gospel or not. Any OS X/Java experts out there willing to > comment? We'd like to be able to install RXTX in the safest, most > maintenance free way possible, but if there are specific reasons why > javax.comm.properties and comm.jar need to be in /System... then so > be it. > > > Any information is welcome, > > > Sean > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Dmitry Markman Dmitry Markman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050622/beea65d0/attachment-0003.html From lyon at docjava.com Thu Jun 23 04:39:47 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 23 Jun 2005 06:39:47 -0400 Subject: [Rxtx] web start + RXTX = strange errors? Message-ID: On: Date: Tue, 21 Jun 2005 11:15:53 +0100 From: Jasmine Strong Writes: An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. ----------- I cannot duplicate your error. My version of Java is: java -version java version "1.4.2_05" Is yours the same? Trent: You wrote: passing -source 1.3 -target 1.3 to javac will compile classes without this problem. ----------- OK, I have updated the disto to work with jdk1.3: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Jasmine: Is this working any better? Thanks! - DL From handzisk at tkn.tu-berlin.de Fri Jun 24 02:37:14 2005 From: handzisk at tkn.tu-berlin.de (Vlado Handziski) Date: Fri, 24 Jun 2005 10:37:14 +0200 (CEST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace Message-ID: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Hi all, let me first express my compliments on the great work you have done with the RXTX library. We have been using the library for some time, and we are at a point where we want to make our code public. For legacy reasons, the code that the RXTX library is bundled with, uses the javax.comm namespace. We have been using the ChangePackage script to change the RXTX2.1 package from gnu.io into javax.comm. We need the independent implementation since we want to be able to directly access /dev/ttyUSBx ports in linux and the CommAPI versions are just not as stable. On the download page, there is a comment that this is in violation of sun's license. Can someone shed more light on this. I was not aware that you can protect the names of the java packages. Best regards, Vlado From ricardo.trindade at emation.pt Fri Jun 24 04:01:17 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 11:01:17 +0100 Subject: [Rxtx] parity missed Message-ID: <42BBD9ED.3060004@emation.pt> Hi, I have a "parity missed error". From previous posts I believe this has to do with CMSPAR not being defined. I checked out 2.1 head from CVS. How can I make sure I do a proper build and CMSPAR is defined ? Perhaps it would be good to have a release snapshot that has this, I think the latest snapshot (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. Another question I have, is why must this depend on kernel headers, why can't it be defined in the RXTX source ? thanks Ricardo From jasmine at electronpusher.org Fri Jun 24 04:09:06 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 24 Jun 2005 11:09:06 +0100 Subject: [Rxtx] web start + RXTX = strange errors? In-Reply-To: References: Message-ID: <644aad2bdbba950f0a2fb12d7dcfd8a6@electronpusher.org> On 23 Jun 2005, at 11:39, Dr. Douglas Lyon wrote: > OK, I have updated the disto to work with jdk1.3: > http://show.docjava.com:8086/book/cgij/code/jnlp/ > addbk.JAddressBook.Main.jnlp > > Jasmine: Is this working any better? Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) -J. From taj at www.linux.org.uk Fri Jun 24 10:54:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 17:54:12 +0100 (BST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: On Fri, 24 Jun 2005, Vlado Handziski wrote: > Hi all, > > let me first express my compliments on the great work you have done with > the RXTX library. > > We have been using the library for some time, and we are at a point where > we want to make our code public. For legacy reasons, the code that the > RXTX library is bundled with, uses the javax.comm namespace. We have been > using the ChangePackage script to change the RXTX2.1 package from gnu.io > into javax.comm. We need the independent implementation since we want to > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > versions are just not as stable. > > On the download page, there is a comment that this is in violation of > sun's license. Can someone shed more light on this. I was not aware that > you can protect the names of the java packages. > > Best regards, > Vlado > I can't provide legal advice as I am not a lawyer. (v) may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are contained in the "java", "javax" or "sun" packages or similar as specified by Sun in any class file naming convention; and The license is in the commapi package from Sun. The above is also in all the EULA's you click through to download from Sun if I'm not mistaken. Simply put, the license taints developers that agree to it. For those developers, Sun has control of the javax.comm namespace. It really does not make sense to put rxtx 2.1 in the javax.comm namespace. It will only cause confusion which I think is the point of the clause above. The gnu.io namespace was perhaps a poor choice and just tossed in when reviewing the license to get out of Sun's namespace. There is nothing in the rxtx license limiting your freedom in this fashion though. Many companies are moving to gnu.io and some distribute it with popular applications you would recognize. I'm tempted to ask you not to contaminate rxtx 2.1 with the javax.comm namespace. You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) extensions to existing classes (which I dont think you are using); it is not just javax.comm. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 24 13:24:09 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 20:24:09 +0100 (BST) Subject: [Rxtx] parity missed In-Reply-To: <42BBD9ED.3060004@emation.pt> References: <42BBD9ED.3060004@emation.pt> Message-ID: On Fri, 24 Jun 2005, Ricardo Trindade wrote: > Hi, > > I have a "parity missed error". From previous posts I believe this > has to do with CMSPAR not being defined. > I checked out 2.1 head from CVS. How can I make sure I do a proper > build and CMSPAR is defined ? Perhaps it would be good to have a release > snapshot that has this, I think the latest snapshot > (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. > > Another question I have, is why must this depend on kernel headers, > why can't it be defined in the RXTX source ? > I used to cheat and grab the CMSPAR from the kernel headers because glibc did not have it. Now rxtx uses the glibc headers and we have a patch in glibc I trust that handles this. It would not be right to override glibc and it wasnt right to use the kernel headers (it really did cause problems). You can override glibc for now with the following in the top of SerialImp.c # define CMSPAR 010000000000 You can check if your distro headers have this right bit looking for the above in bits/termios.h. It should look like this: #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif If it is not defined, please file a bug with your distro as rxtx is not the only thing that will be broken on that distro. I was going to release new cvs snapshots last weekend but got tied up. I'll do it this weekend. I also need to get custom baudrate patches into the cvs snapshot. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Fri Jun 24 13:56:50 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 20:56:50 +0100 Subject: [Rxtx] parity missed In-Reply-To: References: <42BBD9ED.3060004@emation.pt> Message-ID: <42BC6582.2070805@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050624/e3b39631/attachment-0003.html From vlado.handziski at gmail.com Sat Jun 25 06:25:52 2005 From: vlado.handziski at gmail.com (Vlado Handziski) Date: Sat, 25 Jun 2005 14:25:52 +0200 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: <697986ec05062505256ebf381f@mail.gmail.com> Thanks for the clarification. Since changing the bundled source is not an option at this moment, we will consider using javax.comm and RXTX2.0. In the next rewrite, we would probably move to gnu.io . Best regards, Vlado Handziski On 6/24/05, Trent Jarvi wrote: > > On Fri, 24 Jun 2005, Vlado Handziski wrote: > > > Hi all, > > > > let me first express my compliments on the great work you have done with > > the RXTX library. > > > > We have been using the library for some time, and we are at a point > where > > we want to make our code public. For legacy reasons, the code that the > > RXTX library is bundled with, uses the javax.comm namespace. We have > been > > using the ChangePackage script to change the RXTX2.1 package from gnu.io > > into javax.comm. We need the independent implementation since we want to > > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > > versions are just not as stable. > > > > On the download page, there is a comment that this is in violation of > > sun's license. Can someone shed more light on this. I was not aware that > > you can protect the names of the java packages. > > > > Best regards, > > Vlado > > > > I can't provide legal advice as I am not a lawyer. > > (v) may not create, or authorize your licensees to create additional > classes, interfaces, or subpackages that are contained in the "java", > "javax" or "sun" packages or similar as specified by Sun in any class file > naming convention; and > > The license is in the commapi package from Sun. The above is also in all > the EULA's you click through to download from Sun if I'm not mistaken. > > Simply put, the license taints developers that agree to it. For those > developers, Sun has control of the javax.comm namespace. > > It really does not make sense to put rxtx 2.1 in the javax.comm namespace. > It will only cause confusion which I think is the point of the clause > above. The gnu.io namespace was perhaps a poor choice and > just tossed in > when reviewing the license to get out of Sun's namespace. > > There is nothing in the rxtx license limiting your freedom in this fashion > though. Many companies are moving to gnu.io and some > distribute it with > popular applications you would recognize. I'm tempted to ask you not > to contaminate rxtx 2.1 with the javax.comm namespace. > > You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm > using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) > extensions to existing classes (which I dont think you are using); it is > not just javax.comm. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050625/1dadc50e/attachment-0003.html From taj at www.linux.org.uk Sun Jun 26 11:34:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 26 Jun 2005 18:34:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. Message-ID: The attached file should fix baud_base and divisor extensions for Linux The patch is against rxtx 2.1 CVS HEAD. To use this patch, you should set the baud rate to 38400. You can then try SerialPort.setBaudBase(int) and SerialPort.setDivisor(int) There are matching int SerialPort.getBaudBase() and int SerialPort.getDivisor(). What baud bases are available depends upon the serial port card and its driver so this is a bit of a blind attempt on my part. I've looked at the w32 API and I dont see anything available yet. The w32 code in RXTX will probably be figuring out the baud rate based on the tried baud base and divisor and just slamming it at the API for now (the API does something with that but I've not found real documentation on what it does). I dont want to try tinkering with the UART directly yet as that would involve poking machine memory directly and could very easily be error prone in bad ways. I don't expect Solaris or any SysV UNIX systems to work at all with this - ever. It is not standard in any way and will throw Exceptions on everything but Linux (w32 will just fail miserably as it is 1/2 implemented). If anyone has looked at custom baud rates before and has some thoughts or just wants to try the attached untested patch, I'd appreciate any feedback. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- ? autom4te.cache ? build ? output cvs server: Diffing . Index: configure =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure,v retrieving revision 1.35.2.59 diff -u -r1.35.2.59 configure --- configure 16 Oct 2004 16:20:34 -0000 1.35.2.59 +++ configure 26 Jun 2005 16:59:28 -0000 @@ -9644,6 +9644,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { #if defined (__GLIBC__) @@ -9782,6 +9784,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { @@ -9825,7 +9829,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -9837,7 +9841,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 26 Jun 2005 16:59:28 -0000 @@ -218,6 +218,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { #if defined (__GLIBC__) @@ -356,6 +358,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { @@ -399,7 +403,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -411,7 +415,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" cvs server: Diffing CNI cvs server: Diffing MACOSX_IDE cvs server: Diffing MACOSX_IDE/CW cvs server: Diffing MACOSX_IDE/ForPackageMaker cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions cvs server: Diffing MACOSX_IDE/ForPackageMaker/Resources cvs server: Diffing MACOSX_IDE/PB cvs server: Diffing WinCE cvs server: Diffing contrib cvs server: Diffing debian cvs server: Diffing src Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 26 Jun 2005 16:59:29 -0000 @@ -2079,15 +2079,17 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int BaudBase The clock frequency divided by 16. Default * BaudBase is 115200. * @return boolean true on success - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:setBaudBase()"); @@ -2097,10 +2099,11 @@ /** * Extension to CommAPI * @return int BaudBase - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getBaudBase() throws UnsupportedCommOperationException + public int getBaudBase() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getBaudBase()"); @@ -2108,13 +2111,14 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, IOException { if ( debug ) z.reportln( "RXTXPort:setDivisor()"); @@ -2124,10 +2128,11 @@ /** * Extension to CommAPI * @returns int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getDivisor() throws UnsupportedCommOperationException + public int getDivisor() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getDivisor()"); Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 26 Jun 2005 16:59:30 -0000 @@ -1877,16 +1877,27 @@ int fd = get_java_var( env, jobj,"fd","I" ); struct serial_struct sstruct; + if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) + { + goto fail; + } + + sstruct.baud_base = (int) BaudBase; + if ( sstruct.baud_base < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetBaudBase", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetBaudBase", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1914,9 +1925,13 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) ( sstruct.baud_base ) ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetBaudBase", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetBaudBase", strerror( errno ) ); @@ -1950,19 +1965,23 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } if ( sstruct.custom_divisor < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetDivisor", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetDivisor", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1971,7 +1990,7 @@ accept: none perform: Find the Divisor used for custom speeds - return: Divisor + return: Divisor negative value on error. exceptions: Unsupported Comm Operation on systems not supporting TIOCGSERIAL comments: @@ -1990,10 +2009,14 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) sstruct.custom_divisor ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetDivisor", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetDivisor", strerror( errno ) ); @@ -2032,7 +2055,7 @@ /* Open and lock the port so nothing else changes the setting */ - if ( LOCK( filename, pid ) ) goto fail;; + if ( LOCK( filename, pid ) ) goto fail; fd = find_preopened_ports( filename ); if( !fd ) Index: src/SerialPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/Attic/SerialPort.java,v retrieving revision 1.3.2.9 diff -u -r1.3.2.9 SerialPort.java --- src/SerialPort.java 12 Oct 2004 08:59:28 -0000 1.3.2.9 +++ src/SerialPort.java 26 Jun 2005 16:59:30 -0000 @@ -103,13 +103,17 @@ public abstract String getUARTType() throws UnsupportedCommOperationException; public abstract boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getBaudBase() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getDivisor() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setLowLatency() throws UnsupportedCommOperationException; public abstract boolean getLowLatency() cvs server: Diffing src/lfd cvs server: Diffing src/psmisc From uwe at kubosch.no Mon Jun 27 14:13:57 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Mon, 27 Jun 2005 22:13:57 +0200 Subject: [Rxtx] RXTX on FC4 Message-ID: <1119903238.2989.27.camel@BPC0276> Hi all! I just got RXTX to work on Fedora Core 4. The standard download did not work. I had to check the code out from CVS and build it, but then it worked flawlessly. Thanks for your good work. Now I wonder if I should contribute the compiled files so that others will have an easier time than me getting RXTX to work on FC4. What do I do? Who do I talk to? donV From taj at www.linux.org.uk Mon Jun 27 14:29:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 27 Jun 2005 21:29:46 +0100 (BST) Subject: [Rxtx] RXTX on FC4 In-Reply-To: <1119903238.2989.27.camel@BPC0276> References: <1119903238.2989.27.camel@BPC0276> Message-ID: On Mon, 27 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I just got RXTX to work on Fedora Core 4. > > The standard download did not work. > > I had to check the code out from CVS and build it, but then it worked > flawlessly. > > Thanks for your good work. > > Now I wonder if I should contribute the compiled files so that others > will have an easier time than me getting RXTX to work on FC4. What do I > do? Who do I talk to? > > The best thing to do with FC is to contibute an extras RPM. Debian does something like this with their .deb packaging. As rxtx is OS neutral, it is almost impossible to have everything on rxtx.org. If you do get a package in Fedora Extras, I can point a link there. The extra's mail list is here: https://www.redhat.com/mailman/listinfo/fedora-extras-list If it would help to have me release a 'stable' .tar.gz of the source for the RPM submittal process I can do that. It would also trigger upgrades in debian which would not be bad. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Mon Jun 27 16:23:20 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 27 Jun 2005 17:23:20 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: Message-ID: <42C07C58.1030608@atcorp.com> Hey Trent, I installed it and now I get IOExceptions instead of the other one. I'm not sure how those changes would have enabled setDivisor and setBaudBase to work though. Is it significant that this is a USB device emulating a serial port? ~ Shawn From taj at www.linux.org.uk Mon Jun 27 18:07:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 01:07:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: <42C07C58.1030608@atcorp.com> References: <42C07C58.1030608@atcorp.com> Message-ID: On Mon, 27 Jun 2005, Shawn Lavelle wrote: > Hey Trent, > I installed it and now I get IOExceptions instead of the other one. > I'm not sure how those changes would have enabled setDivisor and > setBaudBase to work though. Is it significant that this is a USB device > emulating a serial port? > The USB driver probably does not support this. With USB, the ioctl()'s appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through the linux drivers/usb tree and found to ioctl to support this in Linux 2.6.10. RXTX is not doing very much magic, the patch really only gets the serial struct instead of writing a structure with random values for baudbase and handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel level driver issue not a user space library issue. So if you wanted this to work, the usb serial driver would have to handle the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression after looking through the USB tree quickly. I hope that helps. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Jun 27 18:25:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 27 Jun 2005 20:25:22 -0400 Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) Message-ID: Hi All, I wrote: Jasmine: Is this working any better? And Jasmine says: Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) I am using -source 1.3 and -target 1.3 for the compilation, however, we still seem to have this problem, which my machine (for some reason) does not have. Does anyone have any ideas about what might be the problem? Thanks! - DL From taj at www.linux.org.uk Mon Jun 27 19:04:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 02:04:37 +0100 (BST) Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) In-Reply-To: References: Message-ID: On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I wrote: > Jasmine: Is this working any better? > > And Jasmine says: > Nope. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > > I am using -source 1.3 and -target 1.3 > for the compilation, however, we still seem to have this problem, > which my machine (for some reason) does not have. > Does anyone have any ideas about what might be the problem? > This has shown up in the past with jdk 1.5 compiled jars running on jre 1.4 machines. My guess is either jasmine has an old copy of rxtx with the problem on her machine that is being picked up on the classpath or you have not tried this with jre 1.4. The suggested -source/target fix should avoid the problem. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Mon Jun 27 21:23:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 04:23:55 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: On Tue, 28 Jun 2005, Trent Jarvi wrote: > On Mon, 27 Jun 2005, Shawn Lavelle wrote: > > > Hey Trent, > > I installed it and now I get IOExceptions instead of the other one. > > I'm not sure how those changes would have enabled setDivisor and > > setBaudBase to work though. Is it significant that this is a USB device > > emulating a serial port? > > > > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > > RXTX is not doing very much magic, the patch really only gets the serial > struct instead of writing a structure with random values for baudbase and > handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel > level driver issue not a user space library issue. > > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. > > I hope that helps. > > > It may be possible that you can just modify translate_speed and get_java_baudrate in SerialImp.c to have the new high speds you are after. The defines are in /usr/include/termios.h. #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 You can see many of these are not handled. I dont think CommAPI handled more than 57600 or so. int get_java_baudrate( int native_speed ) { switch( native_speed ) { case B0: return 0; case B50: return 50; case B75: return 75; case B110: return 110; case B134: return 134; case B150: return 150; case B200: return 200; case B300: return 300; case B600: return 600; case B1200: return 1200; case B1800: return 1800; case B2400: return 2400; case B4800: return 4800; case B9600: return 9600; case B19200: return 19200; case B38400: return 38400; case B57600: return 57600; default: return -1; } } int translate_speed( JNIEnv *env, jint speed ) { LEAVE( "RXTXPort:translate_speed" ); switch( speed ) { case 0: return B0; case 50: return B50; case 75: return B75; case 110: return B110; case 134: return B134; case 150: return B150; case 200: return B200; case 300: return B300; case 600: return B600; case 1200: return B1200; case 1800: return B1800; case 2400: return B2400; case 4800: return B4800; case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; #ifdef B57600 case 57600: return B57600; #endif /* B57600 */ #ifdef B115200 case 115200: return B115200; #endif /* B115200 */ #ifdef B230400 case 230400: return B230400; #endif /* B230400 */ #ifdef B460800 case 460800: return B460800; #endif /* B460800 */ #ifdef B14400 case 14400: return B14400; #endif /* B14400 */ #ifdef B28800 case 28800: return B28800; #endif /* B28800 */ #ifdef B128000 /* dima */ case 128000: return B128000; #endif /* dima */ #ifdef B256000 /* dima */ case 256000: return B256000; #endif /* dima */ } /* Handle custom speeds */ if( speed >= 0 ) return speed; else { LEAVE( "RXTXPort:translate_speed: Error condition" ); return -1; } } -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 28 05:20:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 28 Jun 2005 07:20:21 -0400 Subject: [Rxtx] cross-compilation using Make for Mac Message-ID: Hi All, Please excuse the long post; Trent said: >" >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. " Here is what I have on the mac version: java -version java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) When I run: http://show.docjava.com:8086/book/cgij/code/jnlp/math.benchmarks.Dhry.jnlp I get: -- listing properties -- jnlpx.heapsize=NULL,NULL jnlpx.splashport=-1 java.runtime.name=Java(TM) 2 Runtime Environment, Stand... java.protocol.handler.pkgs=com.sun.javaws.net.protocol sun.boot.library.path=/System/Library/Frameworks/JavaVM.fra... java.vm.version=1.4.2-38 awt.nativeDoubleBuffering=true gopherProxySet=false http.auth.serializeRequests=true java.vm.vendor="Apple Computer, Inc." java.vendor.url=http://apple.com/ path.separator=: java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io jnlpx.home=/Applications/Utilities/Java/Java Web... user.country=US sun.os.patch.level=unknown java.vm.specification.name=Java Virtual Machine Specification user.dir=/ java.runtime.version=1.4.2_05-141.4 java.awt.graphicsenv=apple.awt.CGraphicsEnvironment java.endorsed.dirs=/System/Library/Frameworks/JavaVM.fra... os.arch=ppc java.io.tmpdir=/tmp line.separator= java.vm.specification.vendor=Sun Microsystems Inc. jnlpx.remove=false os.name=Mac OS X sun.java2d.fontpath= java.library.path=/Applications/Utilities/Java/Java Web... java.specification.name=Java Platform API Specification java.class.version=48.0 jnlpx.deployment.user.home=/Users/lyon/Library/Caches/Java Web S... java.util.prefs.PreferencesFactory=java.util.prefs.MacOSXPreferencesFactory os.version=10.3.9 user.home=/Users/lyon user.timezone=America/New_York java.security.policy=file:/Applications/Utilities/Java/Jav... java.awt.printerjob=apple.awt.CPrinterJob trustProxy=true java.specification.version=1.4 file.encoding=MacRoman jnlpx.deployment.system.home=/Applications/Utilities/Java/J2SE 5.0... user.name=lyon java.class.path=/Applications/Utilities/Java/Java Web... java.vm.specification.version=1.0 sun.arch.data.model=32 java.home=/System/Library/Frameworks/JavaVM.fra... java.specification.vendor=Sun Microsystems Inc. user.language=en awt.toolkit=apple.awt.CToolkit java.vm.info=mixed mode java.version=1.4.2_05 java.ext.dirs=/Users/lyon/Library/Java/Extensions:/... sun.boot.class.path=/System/Library/Frameworks/JavaVM.fra... java.vendor=Apple Computer, Inc. file.separator=/ java.vendor.url.bug=http://developer.apple.com/java/ sun.cpu.endian=big sun.io.unicode.encoding=UnicodeBig mrj.version=141.3 jnlpx.jvm=/System/Library/Frameworks/JavaVM.fra... sun.cpu.isalist= sun.awt.exception.handler=apple.awt.CToolkit$EventQueueExceptio... javawebstart.version=javaws-1.4.2_05 800 mhz g4,878k ds/sec total time: 1184ms Result: 844594 dhrystone/sec. Load average for last 15 minutes:0.62 So, I feel pretty sure that I have tried this with 1.4. As to modifying the RXTX compilation, that I did not do...and I take your point. I have been using the binary distributions as is. Oops. I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Now when I do a make, I get: make gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known libtool: link: warning: undefined symbols not allowed in i386-pc-mingw32 shared libraries rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ln: `SerialImp.o': File exists make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 So, I do a make clean, then a make: .... (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ar cru .libs/librxtxSerial.a /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o ar: /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o: No such file or directory make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 In the i386 directory, there is a symbolic link left from something: ls -al SerialImp.o lrwxrwxrwx 1 lyon lyon 12 Jun 28 07:03 SerialImp.o -> SerialImp.lo However, the SerialImp.lo is not present (which is the cause of the error, I think). On the other hand, the file I am looking for is present in: i686-pc-linux-gnu Possibly the i386 generation is not clean (of course it is also likely that I am just asking dumb questions, being a newbie to the code and all.). Finally, will this make file regenerate the distro for the mac? I found some really old (from year 2001) files in: cvs/MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions Which I could use for the distro...but I would prefer to do a clean, multi-platform build from make. Thanks! - Doug >On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > >> Hi All, >> I wrote: >> Jasmine: Is this working any better? >> >> And Jasmine says: >> Nope. >> >> An error occurred while launching/running the application. >> >> Title: addbk.JAddressBook.Main >> Vendor: DocJava, Inc. >> Category: Unexpected Error >> >> gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) >> >> > > I am using -source 1.3 and -target 1.3 >> for the compilation, however, we still seem to have this problem, >> which my machine (for some reason) does not have. >> Does anyone have any ideas about what might be the problem? >> > >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. > > >The suggested -source/target fix should avoid the problem. > >-- >Trent Jarvi >tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 28 09:43:41 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 28 Jun 2005 10:43:41 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: <42C1702D.1070307@atcorp.com> > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. There is ioctl stuff in the driver for the chip, but i haven't seen the TIOC*SERIAL entries. That might be why it continues to fail. I did get around the problem, though, by hacking the driver and just specifying the baud rate I need. Now everything works well. Thanks for all the assistance you've provided. ~ Shawn M. Lavelle From taj at www.linux.org.uk Tue Jun 28 12:42:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:42:29 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known Add a compiler flag -DWIN32 The code above should not be compiling on w32 as it is #if !defined(WIN32) You can look at the bottom of Makefile.in to see the w32 compile flags. Search for "WIN32 CrossCompiling from here down" If its still not working, I can set you up with the Bob account. Just email me off the list. W32 compiling is a bit complicated. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 28 12:52:50 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:52:50 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Nods. I did change configure but right now it is only in the baudbase/divisor patch I posted. I'm going to add several extension baud rates that can be supported by normal API calls and commit that today as a followup to my comments yesterday on baudrates. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Wed Jun 29 01:52:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 08:52:10 +0100 (BST) Subject: [Rxtx] [PATCH] More baud rate fixes Message-ID: I went through the native baudrate conversion from Java and added several. This patch is against CVS 2.1 head. I think thats it for baud rate fixes unless someone see something. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- A non-text attachment was scrubbed... Name: baud_base_and_divisor_plus_odd_baudrates.diff.gz Type: application/x-gzip Size: 3291 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050629/4c1ef1c2/baud_base_and_divisor_plus_odd_baudrates.diff-0003.gz From lyon at docjava.com Wed Jun 29 10:33:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 29 Jun 2005 12:33:45 -0400 Subject: [Rxtx] java.comm dependencies Message-ID: Hi All, During a build of the rxtx code, I have left the javax.comm out of the system (on purpose). However, I get an error, at run time: CommPortIdentifier:static initialization() apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: javax/comm/CommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver I am thinking that there is something in the gnu.io.CommPortIdentifier that seeks to load the javax.comm.CommDriver. It was my understanding that we could write code without reference to the javax.comm.CommDriver and that we could work in the gnu namespace. Is this true? Thanks! - Doug From taj at www.linux.org.uk Wed Jun 29 11:16:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 18:16:08 +0100 (BST) Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > During a build of the rxtx code, I have left the > javax.comm out of the system (on purpose). > However, I get an error, at run time: > > CommPortIdentifier:static initialization() > apple.awt.EventQueueExceptionHandler Caught Throwable : > java.lang.NoClassDefFoundError: javax/comm/CommDriver > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > that seeks to load the javax.comm.CommDriver. > > It was my understanding that we could write code without reference > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > Is this true? > Yes. People use 2.1 without javax all the time. There should be no reference to javax at all in rxtx 2.1. You may check your code. I just did a grep through 2.1 and there is nothing. You may look at the classes you are using. If you find javax.comm in your code, replace it with gnu.io and that should be all you need to do. -- Trent Jarvi tjarvi at qbang.org From jayant28k at gmail.com Wed Jun 29 21:49:28 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Thu, 30 Jun 2005 09:19:28 +0530 Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: <6a6a02310506292049778c452f@mail.gmail.com> Trent, I think best idea is to have wiki for rxtx code. So as the traffic is increasing with time. "RXTX" seems to be more popular in embbeded system. Sun Microsystems will always apperciate your efforts on parallel and serial ports commincation based application in IT Industry. Thanks for your help on this forum as "ONE MAN ARMY" ;-) Cheers, Jayant On 6/29/05, Trent Jarvi wrote: > On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > > > Hi All, > > During a build of the rxtx code, I have left the > > javax.comm out of the system (on purpose). > > However, I get an error, at run time: > > > > CommPortIdentifier:static initialization() > > apple.awt.EventQueueExceptionHandler Caught Throwable : > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > > that seeks to load the javax.comm.CommDriver. > > > > It was my understanding that we could write code without reference > > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > > > Is this true? > > > > Yes. People use 2.1 without javax all the time. > > There should be no reference to javax at all in rxtx 2.1. You may check > your code. I just did a grep through 2.1 and there is nothing. You may > look at the classes you are using. > > If you find javax.comm in your code, replace it with gnu.io and that > should be all you need to do. > > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From uwe at kubosch.no Sat Jun 25 02:50:24 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Sat, 25 Jun 2005 10:50:24 +0200 Subject: [Rxtx] RXTX in FC3/FC4 Message-ID: <1119689424.12606.14.camel@BPC0276> Hi all! I am trying to get RXTX to work on Fedora Core, version 3 or 4. I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext directory. I have edited the jre/lib/javax.comm.properties according to the docs. I have tried this with both rxtx 2.0 and 2.1. I have tried on two different machines. I have tried with java 1.4.2 and java 1.5.0, both from Sun. I always get a signall 11 from the native libraries when they are loaded. Is this a common problem? Any help is greatly appreciated. Below is the start of the error message. More can be supplied on demand. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x65015A Function=(null)+0x65015A Library=/lib/ld-linux.so.2 NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) - locked <0xed46f628> (a java.util.Vector) - locked <0xed471708> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xed46ebc0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.InitializeDriver(CommPortIdentifier.java:213) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:248) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:351) at com.jpeterson.x10.module.CM11A.allocate(CM11A.java:1160) at net.sourceforge.cruisecontrol.publishers.X10Publisher.send(X10Publisher.java:182) at net.sourceforge.cruisecontrol.publishers.X10Publisher.turnOff(X10Publisher.java:171) at net.sourceforge.cruisecontrol.publishers.X10Publisher.handleBuild(X10Publisher.java:148) at net.sourceforge.cruisecontrol.publishers.X10Publisher.publish(X10Publisher.java:141) at net.sourceforge.cruisecontrol.Project.publish(Project.java:679) at net.sourceforge.cruisecontrol.Project.build(Project.java:227) at net.sourceforge.cruisecontrol.Project.execute(Project.java:153) at net.sourceforge.cruisecontrol.ProjectWrapper.run(ProjectWrapper.java:66) at java.lang.Thread.run(Thread.java:534) From chris_jh at blueyonder.co.uk Tue Jun 28 05:37:10 2005 From: chris_jh at blueyonder.co.uk (Christopher Harris) Date: Tue, 28 Jun 2005 12:37:10 +0100 Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError Message-ID: <42C13666.9030108@blueyonder.co.uk> Hi I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 32bit) The serial ports work fine with no issues, but when i try to use the parallel port i get this message Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:66) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) I am trying to print a line out to port "/dev/lp0" At first i thought it could not find the librxtxParallel.so file, but when i renamed it i got a different saying it could not find the library. I have tried to run as root no difference. It is really weird, i get no compile errors and the serial ports work fine. I changed the LPRPort.java and commented out the Initialize call method. And just get the same error but for the method open. It is as though it can't see the methods, and yet it can see the library. I did have a bit of check of the JNI implementation in rxtx but could not spot anything. Yours Thankfully Christopher Harris From lyon at docjava.com Thu Jun 30 02:28:09 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 04:28:09 -0400 Subject: [Rxtx] tools Message-ID: Hi All, I have been thinking about automatic cross-platform native method development of Java/C programs. It appears that different binary tools are needed to target different platforms. Configuration seems a bit painful. Is there something better available than make? Is ANT any good at this? Has anyone tried: http://jnipp.sourceforge.net/ Thanks! - Doug From lyon at docjava.com Thu Jun 30 04:11:17 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 06:11:17 -0400 Subject: [Rxtx] javax.comm Message-ID: Hi All, When I load my jar files on a linux box, all is well. However, when I load them on a mac, I get: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver The jar files for the mac are different from the jar files for linux, because recompilation of the native code for the mac has not been easy, for me. As a result, the RXTX jars are tending toward specific versions and platforms. Probably, this is not an ideal situation, but, I suspect, it is common. I have an idea that we could create a single JNLP distro site that we can make reference to that would enable a uniform repository of synchronized signed native methods and jars for RXTX. For example, the one-wire Maxim folks have a real-nice approach where their stuff makes reference to another JNLP file that contains all the stuff we need to make RXTX work. Check it out at: http://www.maxim-ic.com/products/ibutton/software/1wire/OneWireViewer.cfm However, even they have problems on an unconfigured machine: Specified adapter name "DS9097U" is not known * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cannot load default adapter. Please check that the adapter is connected and that no other application is using the port. If you have checked the adapter, the default port might not be selected. Either set the value of the TMEX default using the utility provided with the TMEX Runtime, or create a new file in the /lib folder called onewireviewer.properties with two lines, similar to the following: #native win32 drivers adapter.name={DS9097U} adapter.port=COM1 #or javax.comm drivers adapter.name=DS9097U adapter.port=COM1 The full path to this file should be: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/onewireviewer.properties ---- Wow, that is a show stopper! Configuration is something that we really need to think about as an automatic thing, particularly for web start users. You can't ask a person who wants to run an application to figure out how to alter a properties file. If you know you need one, then get permission and make one...automatically. That makes a lot of sense, to me. Basically, we need an installer. At the very least, all the pre-built binaries and jars needed for the RXTX package on several platforms should be available from a single place. One this happens, we can make a JNLP file that is platform specific, but can give us a level of indirection. Is this something that has been done already? Thanks! - Doug From taj at www.linux.org.uk Thu Jun 30 08:10:22 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 15:10:22 +0100 (BST) Subject: [Rxtx] tools In-Reply-To: References: Message-ID: On Thu, 30 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I have been thinking about automatic cross-platform > native method development of Java/C programs. > > It appears that different binary tools are needed to target different > platforms. Configuration seems a bit painful. > > Is there something better available than make? > > Is ANT any good at this? I'm far from an Ant expert but have used it for other projects. The main problem I see with ant is there is no mainstream support for platform neutral neutral library creation as far as I can tell. I think ant is a fine replacement for make but I've not seen a suitable replacement for autoconf. At that point, make is as good as anything. It should be possible to create a ant build.xml that works on say Solaris, Linux, Windows and Mac OS X. The problem is when you are trying to build a library for embeded ARM from Mac OS X. > Has anyone tried: > http://jnipp.sourceforge.net/ -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:22:02 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:22:02 +0100 (BST) Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <1119689424.12606.14.camel@BPC0276> References: <1119689424.12606.14.camel@BPC0276> Message-ID: On Sat, 25 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I am trying to get RXTX to work on Fedora Core, version 3 or 4. > > I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 > directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext > directory. > > I have edited the jre/lib/javax.comm.properties according to the docs. > > I have tried this with both rxtx 2.0 and 2.1. > > I have tried on two different machines. > > I have tried with java 1.4.2 and java 1.5.0, both from Sun. > > I always get a signall 11 from the native libraries when they are > loaded. Is this a common problem? Any help is greatly appreciated. > Below is the start of the error message. More can be supplied on > demand. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x65015A > Function=(null)+0x65015A > Library=/lib/ld-linux.so.2 > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) If you compile rxtx from source, this will probably go away. I'm not sure what the exact cause is but it looks like the binaries are not suitable for FC3/4. The ABI may have changed since those had been compiled. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:26:56 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:26:56 +0100 (BST) Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError In-Reply-To: <42C13666.9030108@blueyonder.co.uk> References: <42C13666.9030108@blueyonder.co.uk> Message-ID: tOn Tue, 28 Jun 2005, Christopher Harris wrote: > Hi > > I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 > 32bit) > > The serial ports work fine with no issues, but when i try to use the > parallel port i get this message > > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:66) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) > > > I am trying to print a line out to port "/dev/lp0" > > At first i thought it could not find the librxtxParallel.so file, but > when i renamed it i got a different saying it could not find the library. > > I have tried to run as root no difference. > > It is really weird, i get no compile errors and the serial ports work fine. > > I changed the LPRPort.java and commented out the Initialize call method. > And just get the same error but for the method open. > > It is as though it can't see the methods, and yet it can see the library. > I did have a bit of check of the JNI implementation in rxtx but could > not spot anything. > > > You can check if the symbols are in the shared library: nm librxtxSerial.so |grep Initialize If the symbols are not there, there was a build error. Watch very close for build errors while compiling from source. I suspect something isnt behaving right. -- Trent Jarvi tjarvi at qbang.org From allen at adbyrne.us Thu Jun 30 06:55:58 2005 From: allen at adbyrne.us (Allen Byrne) Date: Thu, 30 Jun 2005 07:55:58 -0500 Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> References: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> Message-ID: <200506300755.59159.allen@adbyrne.us> On Thursday 30 June 2005 00:31, rxtx-request at mail.electronpusher.org wrote: > >Message: 8 >Date: Sat, 25 Jun 2005 10:50:24 +0200 >From: Uwe Kubosch >Subject: [Rxtx] RXTX in FC3/FC4 >To: rxtx at mail.electronpusher.org >Message-ID: <1119689424.12606.14.camel at BPC0276> >Content-Type: text/plain > >Hi all! > >I am trying to get RXTX to work on Fedora Core, version 3 or 4. > >I have tried this with both rxtx 2.0 and 2.1. > >I have tried on two different machines. > >I have tried with java 1.4.2 and java 1.5.0, both from Sun. > >I always get a signall 11 from the native libraries when they are >loaded. ?Is this a common problem? ?Any help is greatly appreciated. >Below is the start of the error message. ?More can be supplied on >demand. > >An unexpected exception has been detected in native code outside the VM. >Unexpected Signal : 11 occurred at PC=0x65015A >Function=(null)+0x65015A >Library=/lib/ld-linux.so.2 > I had thi same problem on SUSE9.3 and java 1.5.0. After searching through the archives, I found a patch that required adding a sleep(1000) command in two functions of SerialIO.java. This only was for rxtx2.1, I had no trouble with rxtx2.0. Note, also I had to add the "|1.5*" sequence to the configure.in file to get good *.so libs. Again 2.0 was fine. -- Allen Byrne adbyrne at ieee.org http://modelrr.adbyrne.us From taj at www.linux.org.uk Fri Jun 3 01:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 08:57:29 +0100 (BST) Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 3 09:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 16:57:53 +0100 (BST) Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi at qbang.org From jasmine at electronpusher.org Fri Jun 3 10:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 17:12:21 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 11:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:02:09 +0100 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 11:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:05:10 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From jon.nall at gmail.com Mon Jun 6 09:13:58 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 10:13:58 -0500 Subject: [Rxtx] StackOverflowError Message-ID: I have a fairly small application that is communicating to a microcontroller programmer at 115.2k. I have a test where I try and dump the memory of the microcontroller (whose size is 8k and change). Things are going smoothly and the data looks good. Then after reading out ~6.5k of data, I get a StackOverflowError. The stack trace looks like: CommInterface.serialEvent(): 324 // this is my code RXTXPort.sendEvent(): 732 RXTXPort.eventLoop() [Native] MonitorThread.run(): 1531 I am running on windows and using rxtx-2.1-CVS-20050120. When I increased the stack size to 512k, I could read the entire chip without issue. But that doesn't seem like the right thing to do without root causing what's happening. My code doesn't include any recursion and the stack trace looks terribly short, so I'm a bit confused as to why I'm getting a StackOverflowError. CommInterface.serialEvent() does little more than grab the available bytes, enter a synchronized block, stick them in a common data area for the main thread to use and leave the synchronization block. I guess my question is: are there any known issues with the default stack size when using the latest rxtx on windows? thanks, nall. From taj at www.linux.org.uk Mon Jun 6 09:27:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 16:27:34 +0100 (BST) Subject: [Rxtx] StackOverflowError In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > I have a fairly small application that is communicating to a > microcontroller programmer at 115.2k. I have a test where I try and > dump the memory of the microcontroller (whose size is 8k and change). > Things are going smoothly and the data looks good. Then after reading > out ~6.5k of data, I get a StackOverflowError. The stack trace looks > like: > > CommInterface.serialEvent(): 324 // this is my code > RXTXPort.sendEvent(): 732 > RXTXPort.eventLoop() [Native] > MonitorThread.run(): 1531 > > I am running on windows and using rxtx-2.1-CVS-20050120. When I > increased the stack size to 512k, I could read the entire chip without > issue. But that doesn't seem like the right thing to do without root > causing what's happening. My code doesn't include any recursion and > the stack trace looks terribly short, so I'm a bit confused as to why > I'm getting a StackOverflowError. > > CommInterface.serialEvent() does little more than grab the available > bytes, enter a synchronized block, stick them in a common data area > for the main thread to use and leave the synchronization block. > > I guess my question is: are there any known issues with the default > stack size when using the latest rxtx on windows? > This is the first I've heard of the problem. It is strange as you mention lookin at the stack trace. That cant be taking up too much space. If you just toss the data instead of trying to put it in your work area, does it persist? -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Mon Jun 6 10:09:39 2005 From: lengyel at gmail.com (FL) Date: Mon, 6 Jun 2005 12:09:39 -0400 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on which the jdk1.5.0_03 is installed. I found that the INSTALL documentation seems to be in error. It states that javacomm20-x86.tar.Z (the Java Communications API for Solaris/x86) must be used, in fact this choice led to the following test with theBlackBox sample program in the commapi: root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG BlackBox -p /dev/ttyS0 Port /dev/ttyS0 not found! No serial ports found! Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to cause Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to the Eclipse stable build version 3.1M7 to avoid this. However, I found that using the Solaris/Sparc version of commapi worked on my system. I have documented this on: http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050606/b28fb9a7/attachment-0004.html From taj at www.linux.org.uk Mon Jun 6 10:30:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:30:27 +0100 (BST) Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, FL wrote: > I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on > which the jdk1.5.0_03 is installed. I found that the INSTALL documentation > seems to be in error. It states that javacomm20-x86.tar.Z (the Java > Communications API for Solaris/x86) must be used, in fact this choice led to > the following test with theBlackBox sample program in the commapi: > > root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG > BlackBox -p /dev/ttyS0 > Port /dev/ttyS0 not found! > No serial ports found! > > Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to > cause > Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to > the Eclipse stable build version 3.1M7 to avoid this. > > However, I found that using the Solaris/Sparc version of commapi > worked on my system. > > I have documented this on: > > http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 > Thanks FL. I'll change the documentation to point to the SPARC comm.jar. In the past, any Solaris was good enough, we tried to avoid the w32 comm.jar because it made native calls rxtx would never implement on any OS as they are not platform neutral. I'll withold comments about Sun's comm.jar being different on various CPUs within even the same OS. RXTX 2.1 does not need to do that even acrossed OSs for instance. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 6 10:35:43 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 11:35:43 -0500 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API Message-ID: It seems that Sun's javax.comm site does not include JavaDoc'ed API and the RxTx site has the API, but no real documentation. Is there some site that i'm just missing in my google searches? I'm looking for a copy of the javax.comm API which is documented. Thanks, nall. From taj at www.linux.org.uk Mon Jun 6 10:44:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:44:03 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > It seems that Sun's javax.comm site does not include JavaDoc'ed API > and the RxTx site has the API, but no real documentation. Is there > some site that i'm just missing in my google searches? I'm looking for > a copy of the javax.comm API which is documented. > > Thanks, > nall. Sun's version is with their binary downloads. RXTX tries to match that so I never bothered with more complete JavaDocs. Whatever Sun documents is what we try to do. -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Mon Jun 6 12:13:44 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 6 Jun 2005 14:13:44 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: Message-ID: <20050606181245.528C929D56F@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Trent Jarvi > Sent: Monday, June 06, 2005 12:44 PM > To: Jon Nall; Java RXTX discussion > Subject: Re: [Rxtx] Where can I find JavaDoc on the javax.comm API > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > It seems that Sun's javax.comm site does not include JavaDoc'ed API > > and the RxTx site has the API, but no real documentation. Is there > > some site that i'm just missing in my google searches? I'm > looking for > > a copy of the javax.comm API which is documented. > > > > Thanks, > > nall. > > Sun's version is with their binary downloads. RXTX tries to > match that so I never bothered with more complete JavaDocs. > Whatever Sun documents is what we try to do. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Try http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht ml -Ack From gadelavega at yahoo.com.ar Mon Jun 6 12:58:09 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Mon, 6 Jun 2005 15:58:09 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606181245.528C929D56F@mail.electronpusher.org> Message-ID: <20050606185809.57069.qmail@web14603.mail.yahoo.com> --- "David S. Acker" escribi?: > > -----Original Message----- > > From: rxtx-bounces at mail.electronpusher.org > > [mailto:rxtx-bounces at mail.electronpusher.org] On > Behalf Of Trent Jarvi > > Sent: Monday, June 06, 2005 12:44 PM > > To: Jon Nall; Java RXTX discussion > > Subject: Re: [Rxtx] Where can I find JavaDoc on > the javax.comm API > > > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > > > It seems that Sun's javax.comm site does not > include JavaDoc'ed API > > > and the RxTx site has the API, but no real > documentation. Is there > > > some site that i'm just missing in my google > searches? I'm > > looking for > > > a copy of the javax.comm API which is > documented. > > > > > > Thanks, > > > nall. > > > > Sun's version is with their binary downloads. > RXTX tries to > > match that so I never bothered with more complete > JavaDocs. > > Whatever Sun documents is what we try to do. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > Try > http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > ml > -Ack > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > I'm prety sure it was there... but not anymore. Gonzalo A. de la Vega, BI ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From taj at www.linux.org.uk Mon Jun 6 18:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 01:09:14 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606185809.57069.qmail@web14603.mail.yahoo.com> References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: >> http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > > I'm prety sure it was there... but not anymore. > It is there. Maybe the URL got mangled. Try this http://tinyurl.com/8dfp7 It just redirects you to: http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.html -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 7 05:46:39 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Jun 2005 07:46:39 -0400 Subject: [Rxtx] rxtx under fedora - odd procedures Message-ID: Hi All, I was able to get RXTX communications to work under Fedora, but only after I added myself to the UUCP and LOCK groups, logged out and then logged back in. Both groups appear to be needed in order to access the serial ports. Also the group alter did not take until after I logged out and logged back in. My theory is that you need permission to write to the var/spool directory under fedora and that this is the only way to do it. Logging out and logging back in just seems like an odd thing to do. I suppose some users may have to restart X. Ouch! Is this true? The alter_group command indicates that you need to be an su to alter the group database. Does this mean that my serial port users need a database su able person to use serial port applications under RXTX? If so, what is the procedure to make a transparent install work using Java web start? Should I be prompting users for the su password? Should I be telling users to exit from X and log out? Is this the way other serial communications programs work? Thanks! - Doug From sean_montgomery at baseview.com Tue Jun 7 08:14:51 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 7 Jun 2005 10:14:51 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: >>> http://java.sun.com/products/javacomm/javadocs/javax/comm/package- >>> summary.ht >>> > > >> >> I'm prety sure it was there... but not anymore. >> >> > > It is there. Maybe the URL got mangled. Try this > > http://tinyurl.com/8dfp7 > > It just redirects you to: > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > summary.html > Maybe the issue here is that the info is available without frames from that URL, but when you try to access it with frames (from the link on that page) it doesn't work - it takes you to: http://java.sun.com/products/javacomm/javadocs/index.html Which doesn't have anything useful on it. From gadelavega at yahoo.com.ar Tue Jun 7 08:22:50 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:22:50 -0300 (ART) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: Message-ID: <20050607142251.92850.qmail@web14626.mail.yahoo.com> --- "Dr. Douglas Lyon" escribi?: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the > group > alter did not take until after I logged out and > logged back in. > > My theory is that you need permission to write to > the var/spool > directory under fedora and that this is the only way > to do it. > > Logging out and logging back in just seems like an > odd thing to > do. I suppose some users may have to restart X. > Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port > applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log > out? > Is this the way other serial communications programs > work? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Actually, you need the lock group to acces /var/lock directory, and uucp to acces /dev/ttyS*. You (as root) shuold add all users you will allow to use the serial ports to group uucp and all the ones you'll allow to lock the ports to lock group (rxtx needs both). This is not only for rxtx, but for any use of the serial ports. Next time they login they'll be able to work, so if they are in they'll have to log out first. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From gadelavega at yahoo.com.ar Tue Jun 7 08:23:56 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:23:56 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> Message-ID: <20050607142356.93815.qmail@web14624.mail.yahoo.com> --- Sean Montgomery escribi?: > > On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: > > >>> > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > >>> summary.ht > >>> > > > > > >> > >> I'm prety sure it was there... but not anymore. > >> > >> > > > > It is there. Maybe the URL got mangled. Try this > > > > http://tinyurl.com/8dfp7 > > > > It just redirects you to: > > > > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > > summary.html > > > > Maybe the issue here is that the info is available > without frames > from that URL, but when you try to access it with > frames (from the > link on that page) it doesn't work - it takes you > to: > > http://java.sun.com/products/javacomm/javadocs/index.html > > Which doesn't have anything useful on it. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > That's right, my bad. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From jon.nall at gmail.com Tue Jun 7 08:33:40 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 09:33:40 -0500 Subject: [Rxtx] performance expectations Message-ID: Hi all. I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC microcontroller. The protocol I'm using (which I didn't create) looks like this for the section of code I'm concerned with: PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data PIC -> PC: 0x01 // ACK 0xNN // First 8 bits of data 0xMM // Second 8 bits of data I issue ~2000 of these Read commands. The PIC itself has an input fifo which can store 18 bytes, so I can have 18 read commands in flight at a given time. The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k 8N1. I am measuring the time it takes to perform these 2000 commands at around 30 seconds, which is much longer than I anticipated. With the link fully utilized, I expected: Time per byte transmitted: 115200 / 8 = 14400 bytes/second = ~70 uS/byte Time per response transmitted: ~70 uS/byte * 3 bytes/response = ~210 uS/response Time for 2000 responses to be transmitted: ~210 uS/response * 2000 responses = ~420ms I'm a bit new to this, so I may have made some bad asumptions, but I would have expected a time of a couple of seconds to perform the 2000 reads, not 30+ seconds. I'm obviously missing something here. Can someone help me understand what's going on? Thanks, nall. From taj at www.linux.org.uk Tue Jun 7 09:17:48 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:17:48 +0100 (BST) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the group > alter did not take until after I logged out and logged back in. > > My theory is that you need permission to write to the var/spool > directory under fedora and that this is the only way to do it. > > Logging out and logging back in just seems like an odd thing to > do. I suppose some users may have to restart X. Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log out? > Is this the way other serial communications programs work? > RIght now, rxtx requires you do one of two things. 1) Use lock files (recommended). This requires intervention by the root users to allow users to create lock files and open the ports as you note. 2) configure rxtx with --disable-lockfiles. In this case you need only worry about the permissions on /dev/ttyS* I'm not sure what the default on Fedora is with respect to permisions. This is not very attractive. There is a better way it could be done on Fedora. Fedora comes with lockdev library. I've been considering this for some time. We could use that for the locking and do away with many of the problems. The problem is embeded devices running Linux do not come with liblockdev. But for your use, I would consider adding a new option for locking serial devices using liblockdev. lockdev-devel has a man page with further information. SYNOPSIS #include pid_t dev_testlock( const char * devname); pid_t dev_lock( const char * devname); pid_t dev_relock( const char * devname, pid_t pid); pid_t dev_unlock( const char * devname, pid_t pid); cc [ flag ... ] file ... -llockdev [ library ] This would probably need to be a configure time option to prevent problems on embeded Linux devices but could otherwise be the default on Linux. I could toss a quick patch together if this is confusing. It is actually easier than what rxtx does now. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 09:27:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:27:11 +0100 (BST) Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > Hi all. > I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC > microcontroller. The protocol I'm using (which I didn't create) looks like this > for the section of code I'm concerned with: > > PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data > PIC -> PC: 0x01 // ACK > 0xNN // First 8 bits of data > 0xMM // Second 8 bits of data > > I issue ~2000 of these Read commands. The PIC itself has an input fifo which > can store 18 bytes, so I can have 18 read commands in flight at a given time. > The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k > 8N1. > > I am measuring the time it takes to perform these 2000 commands at around 30 > seconds, which is much longer than I anticipated. With the link fully utilized, > I expected: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte > > Time per response transmitted: > ~70 uS/byte * 3 bytes/response = ~210 uS/response > > Time for 2000 responses to be transmitted: > ~210 uS/response * 2000 responses = ~420ms > > I'm a bit new to this, so I may have made some bad asumptions, but I would have > expected a time of a couple of seconds to perform the 2000 reads, not 30+ > seconds. > > I'm obviously missing something here. Can someone help me understand what's > going on? > I've hooked rxtx in loopback with a scope in the past at 9600 baud (baud rate is not important). Using event notification and just writing a byte on event/read the latencey was around 8-12 ms. The JNI is not an efficient way to use native code - especially for bit banging. So if timing is critical you want to move some of the logic into the native code rather than banging over the JNI. 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your performance. C# has advantages here. If you move your logic into the native layer or use gcj (rxtx will work with that too) most of your latency should vanish. You may have to play with some sleeps in eventLoop at that point to get full native efficiency. With gcj all of rxtx becomes 'native code' as java is just treated as a subset of C++. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 09:38:51 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 10:38:51 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: On 6/7/05, Jon Nall wrote: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte of course that should be divided by 10 to account for the start/stop bits, but it barely changes the end results. From carobizar at free.fr Tue Jun 7 10:21:29 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 7 Jun 2005 18:21:29 +0200 Subject: [Rxtx] (no subject) Message-ID: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Hello ! I am a french student and I have to create an application able to read and write on serial and parallel port and to run on Windows and Linux. For the moment my program run on Windows thanks the Java Communication API (version for Microsoft Windows and Solaris/x86). But it doesn't work on Linux. Does a recent version of an installation documentation exist ? I didn't find one on the RXTX site (nothing for the windows installation and the linux installation deals with a "jcl.jar" that I don't know...). So, I have some questions : 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 version or Linux&w32 version ?) What are the differences between them ? Which of them are the most stable ? 2) Where have I to put the .so and .dll files ? 3) What have I to write on the file javax.comm.properties ? 4) Have I to delete the file win32comm.dll included in the Java Comm API ? 5) Have I to keep both comm.jar and RXTXcomm.jar ? Best regards, Caroline. From debief at telemsa.com Tue Jun 7 10:44:56 2005 From: debief at telemsa.com (DEBIEF Eric) Date: Tue, 7 Jun 2005 18:44:56 +0200 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: <200506071844.56656.debief@telemsa.com> Hi, We are "pushing" RxTx /Java here in a half-duplex link. The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC and application handling) about 25?s/byte. The figures are the barely the same on two environments. Environment 1 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Linux 2.6.3, Mdk 10.0. RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : bytes are lost on the wire. I need to investigate this mystery.... Java : 1.4.2-rc1 Blackdown Environment 2 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Windows 2000 Pro RxTx : 2.0.7. Java : 1.4.2_08 SUN I Hope this help, Eric. _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 7 11:05:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:05:45 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, DEBIEF Eric wrote: > Hi, > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. How many write() calls is this? > > Environment 1 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Linux 2.6.3, Mdk 10.0. > RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : > bytes are lost on the wire. I need to investigate this mystery.... > Java : 1.4.2-rc1 Blackdown > > Environment 2 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Windows 2000 Pro > RxTx : 2.0.7. > Java : 1.4.2_08 SUN > In my event/read/write test I found windows was ~20% faster than linux for some reason (strange part is Windows was in VMWare on the same Linux machine). It was about the same rxtx version. There are many problems with rxtx 1.4 with respect to commapi on windows but its code paths are more simple. What some people want from rxtx is perhaps better served by hacking up the very first release as they just want to read and write which is what rxtx was before Sun released commapi. It sounds like perhaps you are pushing out larger writes which will greatly improve results. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 11:16:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:16:49 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118161289.42a5c989cf6a2@imp4-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: On Tue, 7 Jun 2005 carobizar at free.fr wrote: > > Hello ! > > I am a french student and I have to create an application able to read and write > on serial and parallel port and to run on Windows and Linux. > For the moment my program run on Windows thanks the Java Communication API > (version for Microsoft Windows and Solaris/x86). > But it doesn't work on Linux. > > Does a recent version of an installation documentation exist ? > I didn't find one on the RXTX site (nothing for the windows installation and the > linux installation deals with a "jcl.jar" that I don't know...). > > So, I have some questions : > > 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 > version or Linux&w32 version ?) What are the differences between them ? Which > of them are the most stable ? > Use rxtx 2.0 with commapi for sparc solaris from Sun. If you want your current package javax.comm. > 2) Where have I to put the .so and .dll files ? On Linux just use the source, the configure script will do all of that for you. tar -xzvf rxtx-2.0-version mkdir rxtx-2.0-version/build cd rxtx-2.0-version/build ../configure && make install It will do everything for you. With Windows, you need to create the javax.comm.properties and install the DLL on your path. But you can just use Sun's package too. They are intended to be interchangable. > > 3) What have I to write on the file javax.comm.properties ? Driver=gnu.io.RXTXCommDriver More documentation in INSTALL that comes with the source. Sun's documentation should work too. configure does this for you on Linux. > > 4) Have I to delete the file win32comm.dll included in the Java Comm API ? > No > 5) Have I to keep both comm.jar and RXTXcomm.jar ? > Yes. RXTX 2.1 replaces comm.jar but the package is different (gnu.io) to avoid contaminating Sun's namespace. With rxtx 2.0 you need Sun's comm.jar - they work together. > > Best regards, > Caroline. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Tue Jun 7 12:07:34 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 14:07:34 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 Message-ID: <20050607180632.1543A29D5C8@mail.electronpusher.org> Hello, I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our product includes a built in USB to Serial adapter so that when it is connected to your PC over USB, it appears as a serial port. We had problems with Sun's comm library because it did not detect serial ports coming and going properly. I did run into a few issues with RxTx though. I am building under Windows (we support XP and 2000) under cygwin. I used a simple make file for the c code that works under cygwin and ant to build the java stuff. Attached is a diff file. The patches hit the following issues: ParallelImp.c - I am not using config so there is no config.h for me. Also, gcc didn't like a local file (win32termios.h) getting included with <> . RXTXPort.java - You can get an exception during the writeByte, writeArray, nativeDrain, readByte, read, readArray, readTerminatedArray, and nativeAvailable calls. Without this patch the IOLocked count gets stuck incremented. termios.c - If you try to open a port through CreateFile and get ERROR_ACCESS_DENIED it means someone else is using the port. We need to make sure to use serial_close instead of just close. I found that some devices finish their I/O synchronously. The code was treating this as an error. I also added some checking on the ClearError calls. I found a compile error when debugging is turned on (see the usleep change). SerialImp.c - Again, I don't have a config.h and again we must use quotes and not <> to include win32termios.h . I also commented out a report call since it seems to happen constantly on my system. Feel free to use these in any way that you want or just to ignore them. Thanks! -Dave Acker dacker at nomadio.net Software Engineer Nomadio, Inc. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diffs.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/5671d159/diffs-0004.txt From jon.nall at gmail.com Tue Jun 7 12:28:16 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 13:28:16 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, DEBIEF Eric wrote: > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. Hi. This is helpful, thanks. I can think of 2 reasons I'm not collecting the data as fast as I think I should be: 1) the device to PC connection is not at 100% utilization 2) my SerialPortEventListener processing has too much overhead Are there other explanations I might be missing as to why it takes so long to transfer the data? Thanks. nall. From taj at www.linux.org.uk Tue Jun 7 13:21:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:21:46 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > On 6/7/05, DEBIEF Eric wrote: > > We are "pushing" RxTx /Java here in a half-duplex link. > > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > > and application handling) about 25?s/byte. > > The figures are the barely the same on two environments. > > Hi. > This is helpful, thanks. I can think of 2 reasons I'm not collecting > the data as fast as I think I should be: > 1) the device to PC connection is not at 100% utilization > 2) my SerialPortEventListener processing has too much overhead > > Are there other explanations I might be missing as to why it takes so > long to transfer the data? > Polling the port would probably make more sense. You can set the threshold/timeouts to avoid racing and not deal with the event notification. As mentioned earlier I think the event latency is ~10ms. Keep the event listener around, rxtx 2.* does not close well without it. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 13:27:27 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 14:27:27 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, Trent Jarvi wrote: > Polling the port would probably make more sense. You can set the > threshold/timeouts to avoid racing and not deal with the event > notification. As mentioned earlier I think the event latency is ~10ms. Trent, Thanks for the response. Just to make sure I understand what you're talking about, when you say event latency, do you mean the time it takes from when the byte hits the PC's comm port to when rxtx presents it to user code? So if the link is 100% utilized, will my user code see "hiccups" or a steady stream of data? Thanks for helping a serial port newbie. nall. From dacker at nomadio.net Tue Jun 7 13:32:20 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 15:32:20 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <20050607193118.5499329CAA0@mail.electronpusher.org> Some folks asked about the make file and ant steps. I have JAVA_HOME set as follows: $ echo $JAVA_HOME C:\Program Files\Java\jdk1.5.0_01 I have all the code in rxtx/src put into gnu/io . The make file here doesn't have optimizations turned on. We have not tested with it yet. --------------Begin Makefile------------------ CPPFLAGS="-I$(JAVA_HOME)/include" "-I$(JAVA_HOME)/include/win32" SOBJECTS=SerialImp.o fuserImp.o termios.o fixup.o init.o POBJECTS=ParallelImp.o termios.o init.o DLLS=rxtxParallel.dll rxtxSerial.dll all: $(CLASSES) $(DLLS) rxtxSerial.dll: $(SOBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(SOBJECTS) rxtxParallel.dll: $(POBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(POBJECTS) clean: rm -fv $(SOBJECTS) $(POBJECTS) $(DLLS) %.o: %.c gcc -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< %.o: %.cpp g++ -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< --------------End Makefile------------------ Here is the ant target I use to build the rxtx libs. Our build puts the class files in a bin dir. We copy the dlls to a deploy dir and to the build dir. Eclipse seems to like the dlls in the build dir. The deploy dir is used when we build our full package. --------------Begin Ant Section------------------ --------------End Ant Section------------------ > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > David S. Acker > Sent: Tuesday, June 07, 2005 2:08 PM > To: 'Java RXTX discussion' > Subject: [Rxtx] Patches to 2.1-7pre17 > > Hello, > I am using RxTx with the Nomadio Sensor, > http://www.nomadio.net/ . Our product includes a built in > USB to Serial adapter so that when it is connected to your PC > over USB, it appears as a serial port. We had problems with > Sun's comm library because it did not detect serial ports > coming and going properly. > > I did run into a few issues with RxTx though. I am building > under Windows (we support XP and 2000) under cygwin. I used > a simple make file for the c code that works under cygwin and > ant to build the java stuff. Attached is a diff file. The > patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h > for me. Also, gcc didn't like a local file (win32termios.h) > getting included with <> . > > RXTXPort.java - You can get an exception during the > writeByte, writeArray, nativeDrain, readByte, read, > readArray, readTerminatedArray, and nativeAvailable calls. > Without this patch the IOLocked count gets stuck incremented. > > termios.c - If you try to open a port through CreateFile and > get ERROR_ACCESS_DENIED it means someone else is using the > port. We need to make sure to use serial_close instead of > just close. I found that some devices finish their I/O > synchronously. The code was treating this as an error. I > also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we > must use quotes and not <> to include win32termios.h . I > also commented out a report call since it seems to happen > constantly on my system. > > Feel free to use these in any way that you want or just to > ignore them. > Thanks! > > -Dave Acker > dacker at nomadio.net > Software Engineer > Nomadio, Inc. > From taj at www.linux.org.uk Tue Jun 7 13:37:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:37:45 +0100 (BST) Subject: [Rxtx] Re: Stack Smashing Attack In-Reply-To: <200506072012.48860.ferdinand.tatzig@web.de> References: <200506072012.48860.ferdinand.tatzig@web.de> Message-ID: On Tue, 7 Jun 2005, Ferdinand Tatzig wrote: > Dear Trent > > I am using RXTX for serial port communication between a PC and a payment > transaction terminal. > When I run my application under Windows 2000, an i386-Linux or an i386-FreeBSD > it works as I expect it to do. However, when I start it to run on AMD64 > machine with a 64-bit Gentoo Linux, the VM terminates with the following > error: > > Port found: /dev/ttyS0 > java: stack smashing attack in function configure_port() > > I am using a 64-bit Blackdown-1.4.2-01 VM. > > I have searched the internet but have found no information about this error. > > This is the code of the method which initializes the serial port: > > /** > * initializes a serial port for communication with a terminal; only > * accessible within this class > * > * @param communication > * @param serialPortToBeInitialized > * @param tillInterfaceEventListener > */ > private TillInterfaceSerialPort(Communication communication, > String serialPortToBeInitialized, > TillInterfaceEventListener tillInterfaceEventListener) > throws IOException, PortInUseException, > TillInterfaceSerialPortNotFoundException, > TooManyListenersException, UnsupportedCommOperationException { > serialPortName = "not initialized yet"; > CommPortIdentifier portId = null; > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > boolean portFound = false; > String temporarySerialPortName = "not initialized yet"; > > // look for a serial port > while (portList.hasMoreElements() && !portFound) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > temporarySerialPortName = portId.getName(); > if (temporarySerialPortName.equals(serialPortToBeInitialized)) { > System.out.print("Port found: "); > System.out.println(temporarySerialPortName); > serialPortName = temporarySerialPortName; > portFound = true; > } > } > } > if (portFound) { > > // initialize the found port - this command causes the VM to terminate > serialPort = (SerialPort) portId > .open( > TillInterfaceConstants.APPLICATION_NAME, > TillInterfaceConstants > .TIMEOUT_IN_MILLISECONDS_FOR_OPENING_OF_COMMUNICATION_PORT); > > // add an event listener which listens > // on the serial port and notifies the > // serial port object when input bytes > // have been received at the port > serialPort.addEventListener(tillInterfaceEventListener); > serialPort.notifyOnDataAvailable(true); > > // initialize the physical layer > // parameters of the serial port > serialPort.setSerialPortParams(TillInterfaceConstants.BAUD_RATE, > SerialPort.DATABITS_8, SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > // set the inter-character > // timeout (T2) > serialPort > .enableReceiveTimeout(TillInterfaceConstants.INTERCHARACTER_TIMEOUT_IN_MILLISECONDS); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > } else > throw new TillInterfaceSerialPortNotFoundException(); > } > > Any hint to solve this problem would be kindly appreciated. > The only thing that comes to mind here after looking at the offending function is rxtx used to include asm/termios.h but now we moved to termios.h and had glibc fix their headers. The asm/termios.h caused problems as its termios was smaller than the actual termios. This should be fixed in current rxtx versions but you can just glance at SerialImp.c and make sure it does not include asm/termios.h. I've cc'd the rxtx mail list because there was one other mention of stack problems recently. I have used rxtx on opteron systems with success. I have a bug I'm trying hard to reproduce on suse 64 bit (circa linux 2.4.19) systems though. So far I have not been able to reproduce the bug. That said, with gentoo... I like gentoo but I seriously doubt they do any QA with their kernel and Java. I've seen problems before. If you use gentoo and have Java problems, at least stick to Linus (that is an s there) kernels while using Java. I'm not an expert on gentoo but I've seen patches go into experimental kernels that turn out to break java and are reverted before going to Linus just before I see problems with gentoo on this list. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:16:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:16:14 +0100 (BST) Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: On Tue, 7 Jun 2005, David S. Acker wrote: > Hello, > I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our > product includes a built in USB to Serial adapter so that when it is > connected to your PC over USB, it appears as a serial port. We had problems > with Sun's comm library because it did not detect serial ports coming and > going properly. > > I did run into a few issues with RxTx though. I am building under Windows > (we support XP and 2000) under cygwin. I used a simple make file for the c > code that works under cygwin and ant to build the java stuff. Attached is a > diff file. The patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h for me. Also, > gcc didn't like a local file (win32termios.h) getting included with <> . > > RXTXPort.java - You can get an exception during the writeByte, writeArray, > nativeDrain, readByte, read, readArray, readTerminatedArray, and > nativeAvailable calls. Without this patch the IOLocked count gets stuck > incremented. > > termios.c - If you try to open a port through CreateFile and get > ERROR_ACCESS_DENIED it means someone else is using the port. We need to > make sure to use serial_close instead of just close. I found that some > devices finish their I/O synchronously. The code was treating this as an > error. I also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we must use quotes > and not <> to include win32termios.h . I also commented out a report call > since it seems to happen constantly on my system. > > Feel free to use these in any way that you want or just to ignore them. > Thanks! > Hi Dave These patches look great as is. Thanks. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:33:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:33:16 +0100 (BST) Subject: [Rxtx] Patch to IOLocked (fwd) Message-ID: This appears to be another solution to the locking. Chris, the other option just moves the locking into the finally clause which I think would be a little cleaner though I'm posting this patch to so people can comment. -- Trent Jarvi tjarvi at qbang.org ---------- Forwarded message ---------- Date: Wed, 1 Jun 2005 13:01:32 +0100 From: Christopher Dawes To: taj at www.linux.org.uk Subject: Patch to IOLocked Do you want me to check it out of CVS and then submit changes? Christopher -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXPort.java.diff Type: application/octet-stream Size: 6965 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/c442f9fc/RXTXPort.java-0004.obj From Christopher.Dawes at retail-logic.com Wed Jun 8 00:57:24 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 8 Jun 2005 07:57:24 +0100 Subject: [Rxtx] Patch to IOLocked (fwd) [Virus Checked] In-Reply-To: Message-ID: Agreed, much better Java :-) Thanks Christopher ------------------------------------------- Consultant Engineer Retail Logic Limited Fleet GU51 3TZ Tel: +44 (0)1252 644377 Mob: +44 (0)7899 842759 Fax: +44 (0)1252 776708 rxtx-bounces at mail.electronpusher.org wrote on 07/06/2005 21:33:16: > > This appears to be another solution to the locking. Chris, the other > option just moves the locking into the finally clause which I think would > be a little cleaner though I'm posting this patch to so people can > comment. > > -- > Trent Jarvi > tjarvi at qbang.org > > ---------- Forwarded message ---------- > Date: Wed, 1 Jun 2005 13:01:32 +0100 > From: Christopher Dawes > To: taj at www.linux.org.uk > Subject: Patch to IOLocked > > Do you want me to check it out of CVS and then submit changes? > > Christopher[attachment "RXTXPort.java.diff" deleted by Chris > Dawes/Retaillogic/NISABA] _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx From zempftman at gmail.com Wed Jun 8 07:57:25 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 09:57:25 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Maxwell Zempftman Date: May 27, 2005 5:01 PM Subject: Re: [Rxtx] Kaffe & rxtx & armv5b To: rxtx at mail.linuxgrrls.org Here are the results from working this week: The "NullPointerExceptions" are generated by the software when I choose a bad device file. I discovered that this occurs on the i686-RedHat box as well. This exception seems to be generated only by this particular application, and not by the example programs in contrib. So, for example: java MyApp /dev/null <-- generates NullPointerException java MyApp fake <-- generates NullPointerException java MyApp /dev/ttyS0 <-- does not generate NullPointerException Using the program CommCheck (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it appears as though /dev/ttyS0 is the only valid serial device file on the XScale device, so the errors I was getting are not really be bugs. Although /dev/ttyS0 did not generate NullPointerExceptions, I did encounter this error: --start java MyApp /dev/ttyS0 (going mostly from memory, not exact) PortList.hasMoreElements: true Listening on: /dev/ttyS0 Client connected. >From net: echo kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 vmExcept_setJNIFrame Assert: on 'fp != 0' failed. --end I took a look at exception.h, and it seems as though the problematic code does not exist in newer versions of Kaffe (I have been using CVS-2004-11). Next week I will try to use a newer version, although so far everything but CVS-2004-11 has failed. Also, I the device files I need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with something like this? Thanks, Max. > On 5/21/05, Trent Jarvi wrote: > > I'm not sure what is wrong in the first part. It sounds like your > > application may be swallowing an exception while trying to enumerate the > > port or open it. The usual mistake made it not having permissions to > > either open the port or create the lockfile. There should be examples in > > the contrib directory you can try that enumerate and open ports. Maybe > > that will give you some hints. > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > Sun's code limiting you there though you do need to compile and install > > rxtx for the XScale with Sun's Commapi. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > From taj at www.linux.org.uk Wed Jun 8 08:22:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 15:22:44 +0100 (BST) Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > ---------- Forwarded message ---------- > From: Maxwell Zempftman > Date: May 27, 2005 5:01 PM > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > To: rxtx at mail.linuxgrrls.org > > > Here are the results from working this week: > > The "NullPointerExceptions" are generated by the software when I > choose a bad device file. I discovered that this occurs on the > i686-RedHat box as well. This exception seems to be generated only by > this particular application, and not by the example programs in > contrib. So, for example: > > java MyApp /dev/null <-- generates NullPointerException > java MyApp fake <-- generates NullPointerException > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > Using the program CommCheck > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > appears as though /dev/ttyS0 is the only valid serial device file on > the XScale device, so the errors I was getting are not really be bugs. > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > encounter this error: > > --start > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > PortList.hasMoreElements: true > Listening on: /dev/ttyS0 > Client connected. > >From net: echo > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > --end > > I took a look at exception.h, and it seems as though the problematic > code does not exist in newer versions of Kaffe (I have been using > CVS-2004-11). Next week I will try to use a newer version, although so > far everything but CVS-2004-11 has failed. Also, I the device files I > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > something like this? > In RXTXCommDriver, just look for the following code and add /dev/ttyM to the list. Moxa? if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } So: if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyM", // for Moxa ports "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } Linux just has way too many port types to try enumerating them all. There is potential we can add them back in with udev now. > Thanks, > Max. > > > On 5/21/05, Trent Jarvi wrote: > > > I'm not sure what is wrong in the first part. It sounds like your > > > application may be swallowing an exception while trying to enumerate the > > > port or open it. The usual mistake made it not having permissions to > > > either open the port or create the lockfile. There should be examples in > > > the contrib directory you can try that enumerate and open ports. Maybe > > > that will give you some hints. > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > Sun's code limiting you there though you do need to compile and install > > > rxtx for the XScale with Sun's Commapi. > > > > > > -- > > > Trent Jarvi > > > tjarvi at qbang.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Wed Jun 8 12:16:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 08 Jun 2005 13:16:03 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A60B8D.8080500@cs.umn.edu> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> Message-ID: <42A735E3.8040706@atcorp.com> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual serial comport. This isn't so much of a problem, what is, however, is that the comport does not appear to be able to be set to any arbitrary speed, only those from the data_rate enum. I've not found much on using different speeds, has anyone else encountered anything similar? I greatly appreciate any and all comments and suggestions. Thanks in advance, ~ Shawn Lavelle From zempftman at gmail.com Wed Jun 8 12:50:58 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 14:50:58 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: Thanks Trent! That will solve one of the problems. I don't know when my next chance to work on it will be, but I still need to figure out the error I got when I tried opening '/dev/ttyS0' on the Moxa device regarding a failed assertion, seemed to be a Kaffe issue. Thanks for you help, hope to have results soon, Max Englander. On 6/8/05, Trent Jarvi wrote: > On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > > > ---------- Forwarded message ---------- > > From: Maxwell Zempftman > > Date: May 27, 2005 5:01 PM > > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > > To: rxtx at mail.linuxgrrls.org > > > > > > Here are the results from working this week: > > > > The "NullPointerExceptions" are generated by the software when I > > choose a bad device file. I discovered that this occurs on the > > i686-RedHat box as well. This exception seems to be generated only by > > this particular application, and not by the example programs in > > contrib. So, for example: > > > > java MyApp /dev/null <-- generates NullPointerException > > java MyApp fake <-- generates NullPointerException > > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > > > Using the program CommCheck > > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > > appears as though /dev/ttyS0 is the only valid serial device file on > > the XScale device, so the errors I was getting are not really be bugs. > > > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > > encounter this error: > > > > --start > > > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > > > PortList.hasMoreElements: true > > Listening on: /dev/ttyS0 > > Client connected. > > >From net: echo > > > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > > > --end > > > > I took a look at exception.h, and it seems as though the problematic > > code does not exist in newer versions of Kaffe (I have been using > > CVS-2004-11). Next week I will try to use a newer version, although so > > far everything but CVS-2004-11 has failed. Also, I the device files I > > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > > something like this? > > > > > In RXTXCommDriver, just look for the following code and add /dev/ttyM to > the list. Moxa? > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > So: > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyM", // for Moxa ports > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > Linux just has way too many port types to try enumerating them all. There > is potential we can add them back in with udev now. > > > > > Thanks, > > Max. > > > > > On 5/21/05, Trent Jarvi wrote: > > > > I'm not sure what is wrong in the first part. It sounds like your > > > > application may be swallowing an exception while trying to enumerate the > > > > port or open it. The usual mistake made it not having permissions to > > > > either open the port or create the lockfile. There should be examples in > > > > the contrib directory you can try that enumerate and open ports. Maybe > > > > that will give you some hints. > > > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > > Sun's code limiting you there though you do need to compile and install > > > > rxtx for the XScale with Sun's Commapi. > > > > > > > > -- > > > > Trent Jarvi > > > > tjarvi at qbang.org > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- > Trent Jarvi > tjarvi at qbang.org > From taj at www.linux.org.uk Wed Jun 8 12:53:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 19:53:10 +0100 (BST) Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A735E3.8040706@atcorp.com> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: On Wed, 8 Jun 2005, Shawn Lavelle wrote: > Hello, > I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate > with a virtual serial comport. This isn't so much of a problem, what > is, however, is that the comport does not appear to be able to be set to > any arbitrary speed, only those from the data_rate enum. I've not found > much on using different speeds, has anyone else encountered anything > similar? I greatly appreciate any and all comments and suggestions. > This problem is a bit more tricky than it should be. POSIX systems just have a few specified baud rates. Solaris is one of these systems. CommAPI baud rates probably came from someone looking at Solaris. RXTX tries to be POSIX like. W32 is treated as a POSIX like system via a termios.c file in rxtx. Serial ports have baudbase and divisor. So you can set these to come close to the baudrate you want. Some funky equipment like automobile test equipment use baud rates that are not really possible with PC hardware. But if you get as close as possible by changing baud base and divisor, it works. Windows can actually do this for you. I don't know exactly what their code does but if you pass a baudrate to windows, it will guestimate a baudbase and divisor. So you just pass it 10200 baud and it does its job. This is not of very much use the way rxtx does things though. Linux has the standard POSIX like baud rates but if you set the baud rate to B38400, you can set your own baud base and divisor. This is not POSIX that I know of. W32 has more capability than POSIX like systems too. So I did some work to have windows work like Linux via termios.c But the code is not quit right. SerialImp.c and termios.c need some work so all the various buadrates work on Linux and W32. Most other systems will not work beyond what CommAPI already specifies without writting kernel drivers. This is on my todo list but if someone gets to it first, all the better. -- Trent Jarvi tjarvi at qbang.org From carobizar at free.fr Thu Jun 9 06:39:10 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Thu, 9 Jun 2005 14:39:10 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: <1118320750.42a8386e6d3ce@imp5-q.free.fr> Hi ! Thank you for all your advices. I managed to use rxtx on Windows but I have still some difficulties on Linux. I have yet follow your instructions and the configure file has created : - librxtxSerial.so and librxtxParallel.so in the directory /usr/java/j2sdk1.4.2_08/jre/lib/i386 - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the directory /usr/java/j2sdk1.4.2_08/jre/lib - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext But when I run my program, Some exceptions occur : Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver So, 1) What have I forgotten ? 2) Is it possible to make my application run on Linux without the jdk (only the jre) ? Best regards, Caroline. From taj at www.linux.org.uk Thu Jun 9 07:28:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 9 Jun 2005 14:28:05 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118320750.42a8386e6d3ce@imp5-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: On Thu, 9 Jun 2005 carobizar at free.fr wrote: > Hi ! > Thank you for all your advices. > I managed to use rxtx on Windows but I have still some difficulties on Linux. > I have yet follow your instructions and the configure file has created : > - librxtxSerial.so and librxtxParallel.so in the directory > /usr/java/j2sdk1.4.2_08/jre/lib/i386 > - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the > directory /usr/java/j2sdk1.4.2_08/jre/lib > - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext > > But when I run my program, Some exceptions occur : > Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while > loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > com.sun.comm.SolarisDriver > > So, > 1) What have I forgotten ? > The native (.so) libraries are not installed in a directory the JRE is looking for native libraries in. You may look around and see where the .so libraries are in the JRE. I don't know that the jre/lib/i386 directory is specified as a required directory for JREs. I noticed some do not use it. You may try printing the java.libarary.path to see your options. It is also possible to alter the java.library.path. > 2) Is it possible to make my application run on Linux without the jdk (only the > jre) ? Yes. Though installation from source with the JDK is less error prone. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0004.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 7 15:03:09 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 07 Jun 2005 16:03:09 -0500 Subject: [Rxtx] Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <42A60B8D.8080500@cs.umn.edu> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual comport. This isn't so much of a problem, what is, however, is that the comport is only ever set to 9600 baud. I've not found this as a documented bug, has anyone else encountered anything similar? I'll try and provide more detail tomorrow, but if anyone has any suggestions or encountered this before, I'd like to hear about it. Thanks in advance, ~ Shawn Lavelle From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0004.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0004.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0004.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Mon Jun 20 01:04:40 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 20 Jun 2005 08:04:40 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: <42B66A88.4060806@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050620/9be208a1/attachment-0004.html From fbalzarro at libero.it Mon Jun 20 02:33:52 2005 From: fbalzarro at libero.it (Fabio Balzarro) Date: Mon, 20 Jun 2005 10:33:52 +0200 Subject: [Rxtx] RXTXPort:close detected bad file descriptor Message-ID: I'm using RXTX libraries on IPAQ 4150 PDA with Windows CE 4.20 and Jeode. When I close a serial port with sp.close() (where sp is a SerialPort) sometimes an error occour 1119256168085: RXTXPort:close detected bad file descriptor What can I do? Thanks Fabio ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From slavelle at atcorp.com Mon Jun 20 08:08:19 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 20 Jun 2005 09:08:19 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: <42B6CDD3.4040409@atcorp.com> It turns out that I did have a driver-not-used issue which has now been resolved and I can use RxTx on it (had to add ttyUSB as a valid port), but only at standard baud rates. Does USB have the same restrictions on port speed as regular RS232? ~ Shawn Trent Jarvi wrote: > Just a note here. > > I have requested a FTDI usb device and they offered to send one for the > purpose of trying to get rxtx working. I have no idea how long that takes > though. > > > On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > > >>I'm afraid we're just using the latest version from the FTDI website. I've >>not yet played with linux properly with this and unfortunately I run gentoo >>and haven't yet successfully compiled in the ftdi driver. I'll let you know >>if I get any success. >> >>Appologies >> >>Christopher >> >>-----Original Message----- >>From: rxtx-bounces at mail.electronpusher.org >>[mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle >>Sent: 15 June 2005 00:00 >>To: Java RXTX discussion >>Subject: Re: [Rxtx] Virtual Com Ports >> >>Hmm, the latter sounds like a lot of work. It does find the virtual comport >>in windows, i must have just missed it earlier (sign of a long day). On the >>linux side, I suspect that something is not correct with the driver >>installation becuase it does not give me a tty for it :( >> >>Christopher, May I ask what driver you are using for your FTDI chip? >>Did you ever encounter problems with not getting a tty assigned for it? >> >> >> Thanks for all your help! >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>They will have to show up as a tty device in Linux. Probably ttyUSB? >>>That will need an entry in RXTXCommDriver.java. If they dont show up >>>as a tty device, rxtx cant treat it like a serial port. It just wont >> >>work. >> >>>With COM3, rxtx will try to open the port and perform a timed out read. >>>Usually if a port is not there, the read blows up or the open blows up. >>>Timing out is fine. COM3 used to share interrupts with COM1. I know >>>you can reassign ports in XP. RXTX scans up through COM255. You may >>>try moving it. >>> >>> >>>The code in question is the following in RXTXCommDriver.java >>> >>> >>> if(osName.equals("Linux")) >>> { >>> String[] Temp = { >>> "ttyS", // linux Serial Ports >>> "ttySA", // for the IPAQs >>> "ttyUSB" // for USB frobs >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>> else if(osName.toLowerCase().indexOf("windows") != -1 ) >>> { >>> String[] Temp = { >>> "COM" // win32 serial ports >>> //"//./COM" // win32 serial ports >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>>If COM3 can be read, it should be found. the ttyUSB should work if >>>thats in the version of RXTXCommDriver.java you have. >>> >>>If this is still a problem, it may be that the driver is erroring on >>>what may be considered normal comm port operations such as setting the >>>speed, timeout, threshold, .. One would have to start looking at each >>>function called in the native open() and read(). >>> >>> >>> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>>seems to find the device using rxtx. Looking at the hardware >>>>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>>>linux. I can't seem to get it to show up as a tty(s#) in linux which >>>>is probably just due to my lack of significant linux knowledge. >>>> >>>> ~ Shawn >>>> >>>>Trent Jarvi wrote: >>>> >>>> >>>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>Has anyone here noticed that virtual comports do not get enumerated >>>>>>via CommPortIdentifier.getPortIdentifiers()?? >>>>>> >>>>>>The device I'm trying to talk to uses an fdti usb to serial >>>>>>convertor with a driver that has it show up as a virtual comport. I >>>>>>can enter this port manually and it will be usable but I cannot get >>>>>>it show up automatically (as in the simple serial demo). Any thoughts >> >>on this? >> >>>>> >>>>>Hi Shawn, >>>>> >>>>>What OS is this and what is the name of the virtual port you are >>>>>trying to open? I suspect the name just needs to be added to >> >>RXTXCommDriver.java. >> >>>>_______________________________________________ >>>>Rxtx mailing list >>>>Rxtx at mail.electronpusher.org >>>>http://www.electronpusher.org/mailman/listinfo/rxtx >>>> >>> >>> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From lyon at docjava.com Mon Jun 20 15:06:08 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 20 Jun 2005 17:06:08 -0400 Subject: [Rxtx] testing Message-ID: Hi All, I am testing my new multi-platform Java Webstart RXTX application (Trent: I could not have done it without you!). So far, I think it will work under Linux (x86), Windows XP, Windows 2000 and MacOS X. The application is available as a Java webstart application at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Edit:Preferences: SerialPort Setup... should bring up a dialog box that enables dialing via the modem. Generally, it does not find internal modems (except on the mac). Why, I don't know. Thanks in advance for trying this new app. All feedback on it is welcome. - Doug Lyon From jasmine at electronpusher.org Tue Jun 21 04:15:53 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Tue, 21 Jun 2005 11:15:53 +0100 Subject: [Rxtx] testing In-Reply-To: References: Message-ID: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > Hi All, > I am testing my new multi-platform Java Webstart RXTX application > (Trent: I could not have done it without you!). > > So far, I think it will work under Linux (x86), Windows XP, > Windows 2000 and MacOS X. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. -J. From taj at www.linux.org.uk Tue Jun 21 05:50:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 12:50:23 +0100 (BST) Subject: [Rxtx] testing In-Reply-To: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> References: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> Message-ID: On Tue, 21 Jun 2005, Jasmine Strong wrote: > > On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > > > Hi All, > > I am testing my new multi-platform Java Webstart RXTX application > > (Trent: I could not have done it without you!). > > > > So far, I think it will work under Linux (x86), Windows XP, > > Windows 2000 and MacOS X. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > on my Mac. > passing -source 1.3 -target 1.3 to javac will compile classes without this problem. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 10:19:25 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 11:19:25 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. Sincerely, Jeremyah Payne From ricardo.trindade at emation.pt Tue Jun 21 13:25:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 20:25:00 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B8698C.2060509@emation.pt> Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > From taj at www.linux.org.uk Tue Jun 21 13:39:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:39:43 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <42B8698C.2060509@emation.pt> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> <42B8698C.2060509@emation.pt> Message-ID: It looks like he has an rs422 device/converter. This is not the problematic 'trying to do protocol X with a serial port' situation unless I'm missing something. I'll follow up with the other email I started. On Tue, 21 Jun 2005, Ricardo Trindade wrote: > Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. > > Payne, Jeremyah L (N-CIM) wrote: > > >Good morning, my name is Jeremyah and I am working on a java project to > >interface with some devices. In short, I have a laptop with a PCMIA > >converter that does RS422 running windows 2000. I also will be > >installing some PCI cards into some Linux boxes that will have probably > >4-8 RS422 ports on them. After doing some reading in order to talk > >with these items using my existing java code I will need an additional > >driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > >trying to get a map sort of where I need to make changes. As I see it, > >I would need to subclass SerialPort to my RS422 interface. That would > >link with a DLL or SO implementation that talks with the hardware. I > >also need to change the listing of working ports in the lookup section > >for serial. Does this seem like I am on the right track? Appreciate > >the support. > > > > > >Sincerely, > >Jeremyah Payne > >_______________________________________________ > >Rxtx mailing list > >Rxtx at mail.electronpusher.org > >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 21 13:40:25 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:40:25 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: On Tue, 21 Jun 2005, Payne, Jeremyah L (N-CIM) wrote: > Good morning, my name is Jeremyah and I am working on a java project to > interface with some devices. In short, I have a laptop with a PCMIA > converter that does RS422 running windows 2000. I also will be > installing some PCI cards into some Linux boxes that will have probably > 4-8 RS422 ports on them. After doing some reading in order to talk with > these items using my existing java code I will need an additional > driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > trying to get a map sort of where I need to make changes. As I see it, I > would need to subclass SerialPort to my RS422 interface. That would link > with a DLL or SO implementation that talks with the hardware. I also > need to change the listing of working ports in the lookup section for > serial. Does this seem like I am on the right track? Appreciate the > support. > Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 13:40:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 14:40:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618954@emss02m08.us.lmco.com> I'd like to except I am dealing with NASA. I am basically building a system to monitor 100+ Units that communicate over RS422. They have some converters in place but want to get rid of them. I'll check through the archives. I had started looking yesterday as was leaving work. -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Ricardo Trindade Sent: Tuesday, June 21, 2005 2:25 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From slavelle at atcorp.com Tue Jun 21 14:58:06 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 21 Jun 2005 15:58:06 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: <42B87F5E.4000403@atcorp.com> > Linux has the standard POSIX like baud rates but if you set the baud rate > to B38400, you can set your own baud base and divisor. This is not POSIX > that I know of. W32 has more capability than POSIX like systems too. So > I did some work to have windows work like Linux via termios.c > > But the code is not quit right. SerialImp.c and termios.c need some > work so all the various buadrates work on Linux and W32. Most other > systems will not work beyond what CommAPI already specifies without > writting kernel drivers. > > This is on my todo list but if someone gets to it first, all the better. Hmm, I guess I didn't read this close enough before. Just to be clear, the pieces to setBaudBase and setDivisor are not yet implemented, correct? Thanks, Shawn From sean_montgomery at baseview.com Tue Jun 21 15:14:08 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 21 Jun 2005 17:14:08 -0400 Subject: [Rxtx] OS X installation - file locations Message-ID: <8AB82C7F-0D19-45F9-AE54-A12C59A8495E@baseview.com> Greetings, I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) using the RXTX installation instructions. RXTX worked fine. Basically you've got: - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions - javax.comm.properties in /System/Library/Frameworks/ JavaVM.framework/Home/lib - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ lib/ext My coworker was concerned that the installation required files to be placed in /System/Library... because those directories are "Apple's" and subject to change at Apple's whim, and that it would be safer (less likely to break when a user updates their OS or Java version or what have you) if all the files could be somewhere in /Library... or / Library/Java. My coworker points out that when 3rd party apps like FrontBase and JBoss need to communicate with Java their jars are placed in /Library/Java/Extensions. Granted that RXTX 2.0 is implementing javax.comm and not just a 3rd party extension, might that be the case - that javax.* stuff needs to be in the Java system files? I'm not the Java maven that my coworker is, so I don't know if any of this is gospel or not. Any OS X/Java experts out there willing to comment? We'd like to be able to install RXTX in the safest, most maintenance free way possible, but if there are specific reasons why javax.comm.properties and comm.jar need to be in /System... then so be it. Any information is welcome, Sean From ricardo.trindade at emation.pt Tue Jun 21 15:56:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 22:56:53 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B88D25.7060604@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050621/f6c9f5fe/attachment-0004.html From jeremyah.l.payne at lmco.com Tue Jun 21 15:22:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 16:22:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618955@emss02m08.us.lmco.com> -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Trent Jarvi Sent: Tuesday, June 21, 2005 2:40 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 As of yet we have not decided on the PCI boards to use yet So I am still waiting to se how we will interface to them. But the laptop is ready to use so ill build a test app for that API for now. The overview of class structure is really what I needed. I guess I will use the 2.1 as you suggested. Thanks for the help thus far! BTW, you guys wouldn't happen to keep class diagrams or anything of that nature around would you? If not I will probably end up having to do some anyway for documentation purposes, I could include them. Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From dmarkman at mac.com Tue Jun 21 18:13:28 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 21 Jun 2005 20:13:28 -0400 Subject: [Rxtx] OS X installation - file locations In-Reply-To: References: Message-ID: <044F520C-585C-4B99-82ED-3BA83DB8CE77@mac.com> Apple doesn't recommend to put jars into the /System/Library/Frameworks/JavaVM.framework/Home/lib/ext folder from other hands it's standard java directory to put extentions if you want to support comm api on whole system then I'd recommend to put jars into the /Library/Java/Extensions folder just like you did if you want to support comm api per user put your jars into the ~/ Library/Java/Extensions On Jun 21, 2005, at 5:14 PM, Java RXTX discussion wrote: > Greetings, > > > I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) > using the RXTX installation instructions. RXTX worked fine. > > > Basically you've got: > - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions > - javax.comm.properties in /System/Library/Frameworks/ > JavaVM.framework/Home/lib > - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ > lib/ext > > > My coworker was concerned that the installation required files to be > placed in /System/Library... because those directories are "Apple's" > and subject to change at Apple's whim, and that it would be safer > (less likely to break when a user updates their OS or Java version or > what have you) if all the files could be somewhere in /Library... or / > Library/Java. My coworker points out that when 3rd party apps like > FrontBase and JBoss need to communicate with Java their jars are > placed in /Library/Java/Extensions. Granted that RXTX 2.0 is > implementing javax.comm and not just a 3rd party extension, might > that be the case - that javax.* stuff needs to be in the Java system > files? > > > I'm not the Java maven that my coworker is, so I don't know if any of > this is gospel or not. Any OS X/Java experts out there willing to > comment? We'd like to be able to install RXTX in the safest, most > maintenance free way possible, but if there are specific reasons why > javax.comm.properties and comm.jar need to be in /System... then so > be it. > > > Any information is welcome, > > > Sean > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Dmitry Markman Dmitry Markman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050622/beea65d0/attachment-0004.html From lyon at docjava.com Thu Jun 23 04:39:47 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 23 Jun 2005 06:39:47 -0400 Subject: [Rxtx] web start + RXTX = strange errors? Message-ID: On: Date: Tue, 21 Jun 2005 11:15:53 +0100 From: Jasmine Strong Writes: An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. ----------- I cannot duplicate your error. My version of Java is: java -version java version "1.4.2_05" Is yours the same? Trent: You wrote: passing -source 1.3 -target 1.3 to javac will compile classes without this problem. ----------- OK, I have updated the disto to work with jdk1.3: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Jasmine: Is this working any better? Thanks! - DL From handzisk at tkn.tu-berlin.de Fri Jun 24 02:37:14 2005 From: handzisk at tkn.tu-berlin.de (Vlado Handziski) Date: Fri, 24 Jun 2005 10:37:14 +0200 (CEST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace Message-ID: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Hi all, let me first express my compliments on the great work you have done with the RXTX library. We have been using the library for some time, and we are at a point where we want to make our code public. For legacy reasons, the code that the RXTX library is bundled with, uses the javax.comm namespace. We have been using the ChangePackage script to change the RXTX2.1 package from gnu.io into javax.comm. We need the independent implementation since we want to be able to directly access /dev/ttyUSBx ports in linux and the CommAPI versions are just not as stable. On the download page, there is a comment that this is in violation of sun's license. Can someone shed more light on this. I was not aware that you can protect the names of the java packages. Best regards, Vlado From ricardo.trindade at emation.pt Fri Jun 24 04:01:17 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 11:01:17 +0100 Subject: [Rxtx] parity missed Message-ID: <42BBD9ED.3060004@emation.pt> Hi, I have a "parity missed error". From previous posts I believe this has to do with CMSPAR not being defined. I checked out 2.1 head from CVS. How can I make sure I do a proper build and CMSPAR is defined ? Perhaps it would be good to have a release snapshot that has this, I think the latest snapshot (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. Another question I have, is why must this depend on kernel headers, why can't it be defined in the RXTX source ? thanks Ricardo From jasmine at electronpusher.org Fri Jun 24 04:09:06 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 24 Jun 2005 11:09:06 +0100 Subject: [Rxtx] web start + RXTX = strange errors? In-Reply-To: References: Message-ID: <644aad2bdbba950f0a2fb12d7dcfd8a6@electronpusher.org> On 23 Jun 2005, at 11:39, Dr. Douglas Lyon wrote: > OK, I have updated the disto to work with jdk1.3: > http://show.docjava.com:8086/book/cgij/code/jnlp/ > addbk.JAddressBook.Main.jnlp > > Jasmine: Is this working any better? Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) -J. From taj at www.linux.org.uk Fri Jun 24 10:54:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 17:54:12 +0100 (BST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: On Fri, 24 Jun 2005, Vlado Handziski wrote: > Hi all, > > let me first express my compliments on the great work you have done with > the RXTX library. > > We have been using the library for some time, and we are at a point where > we want to make our code public. For legacy reasons, the code that the > RXTX library is bundled with, uses the javax.comm namespace. We have been > using the ChangePackage script to change the RXTX2.1 package from gnu.io > into javax.comm. We need the independent implementation since we want to > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > versions are just not as stable. > > On the download page, there is a comment that this is in violation of > sun's license. Can someone shed more light on this. I was not aware that > you can protect the names of the java packages. > > Best regards, > Vlado > I can't provide legal advice as I am not a lawyer. (v) may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are contained in the "java", "javax" or "sun" packages or similar as specified by Sun in any class file naming convention; and The license is in the commapi package from Sun. The above is also in all the EULA's you click through to download from Sun if I'm not mistaken. Simply put, the license taints developers that agree to it. For those developers, Sun has control of the javax.comm namespace. It really does not make sense to put rxtx 2.1 in the javax.comm namespace. It will only cause confusion which I think is the point of the clause above. The gnu.io namespace was perhaps a poor choice and just tossed in when reviewing the license to get out of Sun's namespace. There is nothing in the rxtx license limiting your freedom in this fashion though. Many companies are moving to gnu.io and some distribute it with popular applications you would recognize. I'm tempted to ask you not to contaminate rxtx 2.1 with the javax.comm namespace. You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) extensions to existing classes (which I dont think you are using); it is not just javax.comm. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 24 13:24:09 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 20:24:09 +0100 (BST) Subject: [Rxtx] parity missed In-Reply-To: <42BBD9ED.3060004@emation.pt> References: <42BBD9ED.3060004@emation.pt> Message-ID: On Fri, 24 Jun 2005, Ricardo Trindade wrote: > Hi, > > I have a "parity missed error". From previous posts I believe this > has to do with CMSPAR not being defined. > I checked out 2.1 head from CVS. How can I make sure I do a proper > build and CMSPAR is defined ? Perhaps it would be good to have a release > snapshot that has this, I think the latest snapshot > (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. > > Another question I have, is why must this depend on kernel headers, > why can't it be defined in the RXTX source ? > I used to cheat and grab the CMSPAR from the kernel headers because glibc did not have it. Now rxtx uses the glibc headers and we have a patch in glibc I trust that handles this. It would not be right to override glibc and it wasnt right to use the kernel headers (it really did cause problems). You can override glibc for now with the following in the top of SerialImp.c # define CMSPAR 010000000000 You can check if your distro headers have this right bit looking for the above in bits/termios.h. It should look like this: #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif If it is not defined, please file a bug with your distro as rxtx is not the only thing that will be broken on that distro. I was going to release new cvs snapshots last weekend but got tied up. I'll do it this weekend. I also need to get custom baudrate patches into the cvs snapshot. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Fri Jun 24 13:56:50 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 20:56:50 +0100 Subject: [Rxtx] parity missed In-Reply-To: References: <42BBD9ED.3060004@emation.pt> Message-ID: <42BC6582.2070805@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050624/e3b39631/attachment-0004.html From vlado.handziski at gmail.com Sat Jun 25 06:25:52 2005 From: vlado.handziski at gmail.com (Vlado Handziski) Date: Sat, 25 Jun 2005 14:25:52 +0200 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: <697986ec05062505256ebf381f@mail.gmail.com> Thanks for the clarification. Since changing the bundled source is not an option at this moment, we will consider using javax.comm and RXTX2.0. In the next rewrite, we would probably move to gnu.io . Best regards, Vlado Handziski On 6/24/05, Trent Jarvi wrote: > > On Fri, 24 Jun 2005, Vlado Handziski wrote: > > > Hi all, > > > > let me first express my compliments on the great work you have done with > > the RXTX library. > > > > We have been using the library for some time, and we are at a point > where > > we want to make our code public. For legacy reasons, the code that the > > RXTX library is bundled with, uses the javax.comm namespace. We have > been > > using the ChangePackage script to change the RXTX2.1 package from gnu.io > > into javax.comm. We need the independent implementation since we want to > > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > > versions are just not as stable. > > > > On the download page, there is a comment that this is in violation of > > sun's license. Can someone shed more light on this. I was not aware that > > you can protect the names of the java packages. > > > > Best regards, > > Vlado > > > > I can't provide legal advice as I am not a lawyer. > > (v) may not create, or authorize your licensees to create additional > classes, interfaces, or subpackages that are contained in the "java", > "javax" or "sun" packages or similar as specified by Sun in any class file > naming convention; and > > The license is in the commapi package from Sun. The above is also in all > the EULA's you click through to download from Sun if I'm not mistaken. > > Simply put, the license taints developers that agree to it. For those > developers, Sun has control of the javax.comm namespace. > > It really does not make sense to put rxtx 2.1 in the javax.comm namespace. > It will only cause confusion which I think is the point of the clause > above. The gnu.io namespace was perhaps a poor choice and > just tossed in > when reviewing the license to get out of Sun's namespace. > > There is nothing in the rxtx license limiting your freedom in this fashion > though. Many companies are moving to gnu.io and some > distribute it with > popular applications you would recognize. I'm tempted to ask you not > to contaminate rxtx 2.1 with the javax.comm namespace. > > You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm > using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) > extensions to existing classes (which I dont think you are using); it is > not just javax.comm. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050625/1dadc50e/attachment-0004.html From taj at www.linux.org.uk Sun Jun 26 11:34:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 26 Jun 2005 18:34:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. Message-ID: The attached file should fix baud_base and divisor extensions for Linux The patch is against rxtx 2.1 CVS HEAD. To use this patch, you should set the baud rate to 38400. You can then try SerialPort.setBaudBase(int) and SerialPort.setDivisor(int) There are matching int SerialPort.getBaudBase() and int SerialPort.getDivisor(). What baud bases are available depends upon the serial port card and its driver so this is a bit of a blind attempt on my part. I've looked at the w32 API and I dont see anything available yet. The w32 code in RXTX will probably be figuring out the baud rate based on the tried baud base and divisor and just slamming it at the API for now (the API does something with that but I've not found real documentation on what it does). I dont want to try tinkering with the UART directly yet as that would involve poking machine memory directly and could very easily be error prone in bad ways. I don't expect Solaris or any SysV UNIX systems to work at all with this - ever. It is not standard in any way and will throw Exceptions on everything but Linux (w32 will just fail miserably as it is 1/2 implemented). If anyone has looked at custom baud rates before and has some thoughts or just wants to try the attached untested patch, I'd appreciate any feedback. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- ? autom4te.cache ? build ? output cvs server: Diffing . Index: configure =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure,v retrieving revision 1.35.2.59 diff -u -r1.35.2.59 configure --- configure 16 Oct 2004 16:20:34 -0000 1.35.2.59 +++ configure 26 Jun 2005 16:59:28 -0000 @@ -9644,6 +9644,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { #if defined (__GLIBC__) @@ -9782,6 +9784,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { @@ -9825,7 +9829,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -9837,7 +9841,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 26 Jun 2005 16:59:28 -0000 @@ -218,6 +218,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { #if defined (__GLIBC__) @@ -356,6 +358,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { @@ -399,7 +403,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -411,7 +415,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" cvs server: Diffing CNI cvs server: Diffing MACOSX_IDE cvs server: Diffing MACOSX_IDE/CW cvs server: Diffing MACOSX_IDE/ForPackageMaker cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions cvs server: Diffing MACOSX_IDE/ForPackageMaker/Resources cvs server: Diffing MACOSX_IDE/PB cvs server: Diffing WinCE cvs server: Diffing contrib cvs server: Diffing debian cvs server: Diffing src Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 26 Jun 2005 16:59:29 -0000 @@ -2079,15 +2079,17 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int BaudBase The clock frequency divided by 16. Default * BaudBase is 115200. * @return boolean true on success - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:setBaudBase()"); @@ -2097,10 +2099,11 @@ /** * Extension to CommAPI * @return int BaudBase - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getBaudBase() throws UnsupportedCommOperationException + public int getBaudBase() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getBaudBase()"); @@ -2108,13 +2111,14 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, IOException { if ( debug ) z.reportln( "RXTXPort:setDivisor()"); @@ -2124,10 +2128,11 @@ /** * Extension to CommAPI * @returns int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getDivisor() throws UnsupportedCommOperationException + public int getDivisor() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getDivisor()"); Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 26 Jun 2005 16:59:30 -0000 @@ -1877,16 +1877,27 @@ int fd = get_java_var( env, jobj,"fd","I" ); struct serial_struct sstruct; + if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) + { + goto fail; + } + + sstruct.baud_base = (int) BaudBase; + if ( sstruct.baud_base < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetBaudBase", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetBaudBase", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1914,9 +1925,13 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) ( sstruct.baud_base ) ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetBaudBase", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetBaudBase", strerror( errno ) ); @@ -1950,19 +1965,23 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } if ( sstruct.custom_divisor < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetDivisor", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetDivisor", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1971,7 +1990,7 @@ accept: none perform: Find the Divisor used for custom speeds - return: Divisor + return: Divisor negative value on error. exceptions: Unsupported Comm Operation on systems not supporting TIOCGSERIAL comments: @@ -1990,10 +2009,14 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) sstruct.custom_divisor ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetDivisor", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetDivisor", strerror( errno ) ); @@ -2032,7 +2055,7 @@ /* Open and lock the port so nothing else changes the setting */ - if ( LOCK( filename, pid ) ) goto fail;; + if ( LOCK( filename, pid ) ) goto fail; fd = find_preopened_ports( filename ); if( !fd ) Index: src/SerialPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/Attic/SerialPort.java,v retrieving revision 1.3.2.9 diff -u -r1.3.2.9 SerialPort.java --- src/SerialPort.java 12 Oct 2004 08:59:28 -0000 1.3.2.9 +++ src/SerialPort.java 26 Jun 2005 16:59:30 -0000 @@ -103,13 +103,17 @@ public abstract String getUARTType() throws UnsupportedCommOperationException; public abstract boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getBaudBase() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getDivisor() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setLowLatency() throws UnsupportedCommOperationException; public abstract boolean getLowLatency() cvs server: Diffing src/lfd cvs server: Diffing src/psmisc From uwe at kubosch.no Mon Jun 27 14:13:57 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Mon, 27 Jun 2005 22:13:57 +0200 Subject: [Rxtx] RXTX on FC4 Message-ID: <1119903238.2989.27.camel@BPC0276> Hi all! I just got RXTX to work on Fedora Core 4. The standard download did not work. I had to check the code out from CVS and build it, but then it worked flawlessly. Thanks for your good work. Now I wonder if I should contribute the compiled files so that others will have an easier time than me getting RXTX to work on FC4. What do I do? Who do I talk to? donV From taj at www.linux.org.uk Mon Jun 27 14:29:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 27 Jun 2005 21:29:46 +0100 (BST) Subject: [Rxtx] RXTX on FC4 In-Reply-To: <1119903238.2989.27.camel@BPC0276> References: <1119903238.2989.27.camel@BPC0276> Message-ID: On Mon, 27 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I just got RXTX to work on Fedora Core 4. > > The standard download did not work. > > I had to check the code out from CVS and build it, but then it worked > flawlessly. > > Thanks for your good work. > > Now I wonder if I should contribute the compiled files so that others > will have an easier time than me getting RXTX to work on FC4. What do I > do? Who do I talk to? > > The best thing to do with FC is to contibute an extras RPM. Debian does something like this with their .deb packaging. As rxtx is OS neutral, it is almost impossible to have everything on rxtx.org. If you do get a package in Fedora Extras, I can point a link there. The extra's mail list is here: https://www.redhat.com/mailman/listinfo/fedora-extras-list If it would help to have me release a 'stable' .tar.gz of the source for the RPM submittal process I can do that. It would also trigger upgrades in debian which would not be bad. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Mon Jun 27 16:23:20 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 27 Jun 2005 17:23:20 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: Message-ID: <42C07C58.1030608@atcorp.com> Hey Trent, I installed it and now I get IOExceptions instead of the other one. I'm not sure how those changes would have enabled setDivisor and setBaudBase to work though. Is it significant that this is a USB device emulating a serial port? ~ Shawn From taj at www.linux.org.uk Mon Jun 27 18:07:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 01:07:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: <42C07C58.1030608@atcorp.com> References: <42C07C58.1030608@atcorp.com> Message-ID: On Mon, 27 Jun 2005, Shawn Lavelle wrote: > Hey Trent, > I installed it and now I get IOExceptions instead of the other one. > I'm not sure how those changes would have enabled setDivisor and > setBaudBase to work though. Is it significant that this is a USB device > emulating a serial port? > The USB driver probably does not support this. With USB, the ioctl()'s appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through the linux drivers/usb tree and found to ioctl to support this in Linux 2.6.10. RXTX is not doing very much magic, the patch really only gets the serial struct instead of writing a structure with random values for baudbase and handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel level driver issue not a user space library issue. So if you wanted this to work, the usb serial driver would have to handle the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression after looking through the USB tree quickly. I hope that helps. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Jun 27 18:25:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 27 Jun 2005 20:25:22 -0400 Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) Message-ID: Hi All, I wrote: Jasmine: Is this working any better? And Jasmine says: Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) I am using -source 1.3 and -target 1.3 for the compilation, however, we still seem to have this problem, which my machine (for some reason) does not have. Does anyone have any ideas about what might be the problem? Thanks! - DL From taj at www.linux.org.uk Mon Jun 27 19:04:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 02:04:37 +0100 (BST) Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) In-Reply-To: References: Message-ID: On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I wrote: > Jasmine: Is this working any better? > > And Jasmine says: > Nope. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > > I am using -source 1.3 and -target 1.3 > for the compilation, however, we still seem to have this problem, > which my machine (for some reason) does not have. > Does anyone have any ideas about what might be the problem? > This has shown up in the past with jdk 1.5 compiled jars running on jre 1.4 machines. My guess is either jasmine has an old copy of rxtx with the problem on her machine that is being picked up on the classpath or you have not tried this with jre 1.4. The suggested -source/target fix should avoid the problem. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Mon Jun 27 21:23:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 04:23:55 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: On Tue, 28 Jun 2005, Trent Jarvi wrote: > On Mon, 27 Jun 2005, Shawn Lavelle wrote: > > > Hey Trent, > > I installed it and now I get IOExceptions instead of the other one. > > I'm not sure how those changes would have enabled setDivisor and > > setBaudBase to work though. Is it significant that this is a USB device > > emulating a serial port? > > > > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > > RXTX is not doing very much magic, the patch really only gets the serial > struct instead of writing a structure with random values for baudbase and > handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel > level driver issue not a user space library issue. > > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. > > I hope that helps. > > > It may be possible that you can just modify translate_speed and get_java_baudrate in SerialImp.c to have the new high speds you are after. The defines are in /usr/include/termios.h. #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 You can see many of these are not handled. I dont think CommAPI handled more than 57600 or so. int get_java_baudrate( int native_speed ) { switch( native_speed ) { case B0: return 0; case B50: return 50; case B75: return 75; case B110: return 110; case B134: return 134; case B150: return 150; case B200: return 200; case B300: return 300; case B600: return 600; case B1200: return 1200; case B1800: return 1800; case B2400: return 2400; case B4800: return 4800; case B9600: return 9600; case B19200: return 19200; case B38400: return 38400; case B57600: return 57600; default: return -1; } } int translate_speed( JNIEnv *env, jint speed ) { LEAVE( "RXTXPort:translate_speed" ); switch( speed ) { case 0: return B0; case 50: return B50; case 75: return B75; case 110: return B110; case 134: return B134; case 150: return B150; case 200: return B200; case 300: return B300; case 600: return B600; case 1200: return B1200; case 1800: return B1800; case 2400: return B2400; case 4800: return B4800; case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; #ifdef B57600 case 57600: return B57600; #endif /* B57600 */ #ifdef B115200 case 115200: return B115200; #endif /* B115200 */ #ifdef B230400 case 230400: return B230400; #endif /* B230400 */ #ifdef B460800 case 460800: return B460800; #endif /* B460800 */ #ifdef B14400 case 14400: return B14400; #endif /* B14400 */ #ifdef B28800 case 28800: return B28800; #endif /* B28800 */ #ifdef B128000 /* dima */ case 128000: return B128000; #endif /* dima */ #ifdef B256000 /* dima */ case 256000: return B256000; #endif /* dima */ } /* Handle custom speeds */ if( speed >= 0 ) return speed; else { LEAVE( "RXTXPort:translate_speed: Error condition" ); return -1; } } -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 28 05:20:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 28 Jun 2005 07:20:21 -0400 Subject: [Rxtx] cross-compilation using Make for Mac Message-ID: Hi All, Please excuse the long post; Trent said: >" >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. " Here is what I have on the mac version: java -version java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) When I run: http://show.docjava.com:8086/book/cgij/code/jnlp/math.benchmarks.Dhry.jnlp I get: -- listing properties -- jnlpx.heapsize=NULL,NULL jnlpx.splashport=-1 java.runtime.name=Java(TM) 2 Runtime Environment, Stand... java.protocol.handler.pkgs=com.sun.javaws.net.protocol sun.boot.library.path=/System/Library/Frameworks/JavaVM.fra... java.vm.version=1.4.2-38 awt.nativeDoubleBuffering=true gopherProxySet=false http.auth.serializeRequests=true java.vm.vendor="Apple Computer, Inc." java.vendor.url=http://apple.com/ path.separator=: java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io jnlpx.home=/Applications/Utilities/Java/Java Web... user.country=US sun.os.patch.level=unknown java.vm.specification.name=Java Virtual Machine Specification user.dir=/ java.runtime.version=1.4.2_05-141.4 java.awt.graphicsenv=apple.awt.CGraphicsEnvironment java.endorsed.dirs=/System/Library/Frameworks/JavaVM.fra... os.arch=ppc java.io.tmpdir=/tmp line.separator= java.vm.specification.vendor=Sun Microsystems Inc. jnlpx.remove=false os.name=Mac OS X sun.java2d.fontpath= java.library.path=/Applications/Utilities/Java/Java Web... java.specification.name=Java Platform API Specification java.class.version=48.0 jnlpx.deployment.user.home=/Users/lyon/Library/Caches/Java Web S... java.util.prefs.PreferencesFactory=java.util.prefs.MacOSXPreferencesFactory os.version=10.3.9 user.home=/Users/lyon user.timezone=America/New_York java.security.policy=file:/Applications/Utilities/Java/Jav... java.awt.printerjob=apple.awt.CPrinterJob trustProxy=true java.specification.version=1.4 file.encoding=MacRoman jnlpx.deployment.system.home=/Applications/Utilities/Java/J2SE 5.0... user.name=lyon java.class.path=/Applications/Utilities/Java/Java Web... java.vm.specification.version=1.0 sun.arch.data.model=32 java.home=/System/Library/Frameworks/JavaVM.fra... java.specification.vendor=Sun Microsystems Inc. user.language=en awt.toolkit=apple.awt.CToolkit java.vm.info=mixed mode java.version=1.4.2_05 java.ext.dirs=/Users/lyon/Library/Java/Extensions:/... sun.boot.class.path=/System/Library/Frameworks/JavaVM.fra... java.vendor=Apple Computer, Inc. file.separator=/ java.vendor.url.bug=http://developer.apple.com/java/ sun.cpu.endian=big sun.io.unicode.encoding=UnicodeBig mrj.version=141.3 jnlpx.jvm=/System/Library/Frameworks/JavaVM.fra... sun.cpu.isalist= sun.awt.exception.handler=apple.awt.CToolkit$EventQueueExceptio... javawebstart.version=javaws-1.4.2_05 800 mhz g4,878k ds/sec total time: 1184ms Result: 844594 dhrystone/sec. Load average for last 15 minutes:0.62 So, I feel pretty sure that I have tried this with 1.4. As to modifying the RXTX compilation, that I did not do...and I take your point. I have been using the binary distributions as is. Oops. I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Now when I do a make, I get: make gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known libtool: link: warning: undefined symbols not allowed in i386-pc-mingw32 shared libraries rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ln: `SerialImp.o': File exists make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 So, I do a make clean, then a make: .... (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ar cru .libs/librxtxSerial.a /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o ar: /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o: No such file or directory make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 In the i386 directory, there is a symbolic link left from something: ls -al SerialImp.o lrwxrwxrwx 1 lyon lyon 12 Jun 28 07:03 SerialImp.o -> SerialImp.lo However, the SerialImp.lo is not present (which is the cause of the error, I think). On the other hand, the file I am looking for is present in: i686-pc-linux-gnu Possibly the i386 generation is not clean (of course it is also likely that I am just asking dumb questions, being a newbie to the code and all.). Finally, will this make file regenerate the distro for the mac? I found some really old (from year 2001) files in: cvs/MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions Which I could use for the distro...but I would prefer to do a clean, multi-platform build from make. Thanks! - Doug >On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > >> Hi All, >> I wrote: >> Jasmine: Is this working any better? >> >> And Jasmine says: >> Nope. >> >> An error occurred while launching/running the application. >> >> Title: addbk.JAddressBook.Main >> Vendor: DocJava, Inc. >> Category: Unexpected Error >> >> gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) >> >> > > I am using -source 1.3 and -target 1.3 >> for the compilation, however, we still seem to have this problem, >> which my machine (for some reason) does not have. >> Does anyone have any ideas about what might be the problem? >> > >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. > > >The suggested -source/target fix should avoid the problem. > >-- >Trent Jarvi >tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 28 09:43:41 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 28 Jun 2005 10:43:41 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: <42C1702D.1070307@atcorp.com> > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. There is ioctl stuff in the driver for the chip, but i haven't seen the TIOC*SERIAL entries. That might be why it continues to fail. I did get around the problem, though, by hacking the driver and just specifying the baud rate I need. Now everything works well. Thanks for all the assistance you've provided. ~ Shawn M. Lavelle From taj at www.linux.org.uk Tue Jun 28 12:42:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:42:29 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known Add a compiler flag -DWIN32 The code above should not be compiling on w32 as it is #if !defined(WIN32) You can look at the bottom of Makefile.in to see the w32 compile flags. Search for "WIN32 CrossCompiling from here down" If its still not working, I can set you up with the Bob account. Just email me off the list. W32 compiling is a bit complicated. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 28 12:52:50 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:52:50 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Nods. I did change configure but right now it is only in the baudbase/divisor patch I posted. I'm going to add several extension baud rates that can be supported by normal API calls and commit that today as a followup to my comments yesterday on baudrates. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Wed Jun 29 01:52:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 08:52:10 +0100 (BST) Subject: [Rxtx] [PATCH] More baud rate fixes Message-ID: I went through the native baudrate conversion from Java and added several. This patch is against CVS 2.1 head. I think thats it for baud rate fixes unless someone see something. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- A non-text attachment was scrubbed... Name: baud_base_and_divisor_plus_odd_baudrates.diff.gz Type: application/x-gzip Size: 3291 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050629/4c1ef1c2/baud_base_and_divisor_plus_odd_baudrates.diff-0004.gz From lyon at docjava.com Wed Jun 29 10:33:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 29 Jun 2005 12:33:45 -0400 Subject: [Rxtx] java.comm dependencies Message-ID: Hi All, During a build of the rxtx code, I have left the javax.comm out of the system (on purpose). However, I get an error, at run time: CommPortIdentifier:static initialization() apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: javax/comm/CommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver I am thinking that there is something in the gnu.io.CommPortIdentifier that seeks to load the javax.comm.CommDriver. It was my understanding that we could write code without reference to the javax.comm.CommDriver and that we could work in the gnu namespace. Is this true? Thanks! - Doug From taj at www.linux.org.uk Wed Jun 29 11:16:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 18:16:08 +0100 (BST) Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > During a build of the rxtx code, I have left the > javax.comm out of the system (on purpose). > However, I get an error, at run time: > > CommPortIdentifier:static initialization() > apple.awt.EventQueueExceptionHandler Caught Throwable : > java.lang.NoClassDefFoundError: javax/comm/CommDriver > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > that seeks to load the javax.comm.CommDriver. > > It was my understanding that we could write code without reference > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > Is this true? > Yes. People use 2.1 without javax all the time. There should be no reference to javax at all in rxtx 2.1. You may check your code. I just did a grep through 2.1 and there is nothing. You may look at the classes you are using. If you find javax.comm in your code, replace it with gnu.io and that should be all you need to do. -- Trent Jarvi tjarvi at qbang.org From jayant28k at gmail.com Wed Jun 29 21:49:28 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Thu, 30 Jun 2005 09:19:28 +0530 Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: <6a6a02310506292049778c452f@mail.gmail.com> Trent, I think best idea is to have wiki for rxtx code. So as the traffic is increasing with time. "RXTX" seems to be more popular in embbeded system. Sun Microsystems will always apperciate your efforts on parallel and serial ports commincation based application in IT Industry. Thanks for your help on this forum as "ONE MAN ARMY" ;-) Cheers, Jayant On 6/29/05, Trent Jarvi wrote: > On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > > > Hi All, > > During a build of the rxtx code, I have left the > > javax.comm out of the system (on purpose). > > However, I get an error, at run time: > > > > CommPortIdentifier:static initialization() > > apple.awt.EventQueueExceptionHandler Caught Throwable : > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > > that seeks to load the javax.comm.CommDriver. > > > > It was my understanding that we could write code without reference > > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > > > Is this true? > > > > Yes. People use 2.1 without javax all the time. > > There should be no reference to javax at all in rxtx 2.1. You may check > your code. I just did a grep through 2.1 and there is nothing. You may > look at the classes you are using. > > If you find javax.comm in your code, replace it with gnu.io and that > should be all you need to do. > > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From uwe at kubosch.no Sat Jun 25 02:50:24 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Sat, 25 Jun 2005 10:50:24 +0200 Subject: [Rxtx] RXTX in FC3/FC4 Message-ID: <1119689424.12606.14.camel@BPC0276> Hi all! I am trying to get RXTX to work on Fedora Core, version 3 or 4. I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext directory. I have edited the jre/lib/javax.comm.properties according to the docs. I have tried this with both rxtx 2.0 and 2.1. I have tried on two different machines. I have tried with java 1.4.2 and java 1.5.0, both from Sun. I always get a signall 11 from the native libraries when they are loaded. Is this a common problem? Any help is greatly appreciated. Below is the start of the error message. More can be supplied on demand. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x65015A Function=(null)+0x65015A Library=/lib/ld-linux.so.2 NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) - locked <0xed46f628> (a java.util.Vector) - locked <0xed471708> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xed46ebc0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.InitializeDriver(CommPortIdentifier.java:213) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:248) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:351) at com.jpeterson.x10.module.CM11A.allocate(CM11A.java:1160) at net.sourceforge.cruisecontrol.publishers.X10Publisher.send(X10Publisher.java:182) at net.sourceforge.cruisecontrol.publishers.X10Publisher.turnOff(X10Publisher.java:171) at net.sourceforge.cruisecontrol.publishers.X10Publisher.handleBuild(X10Publisher.java:148) at net.sourceforge.cruisecontrol.publishers.X10Publisher.publish(X10Publisher.java:141) at net.sourceforge.cruisecontrol.Project.publish(Project.java:679) at net.sourceforge.cruisecontrol.Project.build(Project.java:227) at net.sourceforge.cruisecontrol.Project.execute(Project.java:153) at net.sourceforge.cruisecontrol.ProjectWrapper.run(ProjectWrapper.java:66) at java.lang.Thread.run(Thread.java:534) From chris_jh at blueyonder.co.uk Tue Jun 28 05:37:10 2005 From: chris_jh at blueyonder.co.uk (Christopher Harris) Date: Tue, 28 Jun 2005 12:37:10 +0100 Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError Message-ID: <42C13666.9030108@blueyonder.co.uk> Hi I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 32bit) The serial ports work fine with no issues, but when i try to use the parallel port i get this message Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:66) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) I am trying to print a line out to port "/dev/lp0" At first i thought it could not find the librxtxParallel.so file, but when i renamed it i got a different saying it could not find the library. I have tried to run as root no difference. It is really weird, i get no compile errors and the serial ports work fine. I changed the LPRPort.java and commented out the Initialize call method. And just get the same error but for the method open. It is as though it can't see the methods, and yet it can see the library. I did have a bit of check of the JNI implementation in rxtx but could not spot anything. Yours Thankfully Christopher Harris From lyon at docjava.com Thu Jun 30 02:28:09 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 04:28:09 -0400 Subject: [Rxtx] tools Message-ID: Hi All, I have been thinking about automatic cross-platform native method development of Java/C programs. It appears that different binary tools are needed to target different platforms. Configuration seems a bit painful. Is there something better available than make? Is ANT any good at this? Has anyone tried: http://jnipp.sourceforge.net/ Thanks! - Doug From lyon at docjava.com Thu Jun 30 04:11:17 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 06:11:17 -0400 Subject: [Rxtx] javax.comm Message-ID: Hi All, When I load my jar files on a linux box, all is well. However, when I load them on a mac, I get: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver The jar files for the mac are different from the jar files for linux, because recompilation of the native code for the mac has not been easy, for me. As a result, the RXTX jars are tending toward specific versions and platforms. Probably, this is not an ideal situation, but, I suspect, it is common. I have an idea that we could create a single JNLP distro site that we can make reference to that would enable a uniform repository of synchronized signed native methods and jars for RXTX. For example, the one-wire Maxim folks have a real-nice approach where their stuff makes reference to another JNLP file that contains all the stuff we need to make RXTX work. Check it out at: http://www.maxim-ic.com/products/ibutton/software/1wire/OneWireViewer.cfm However, even they have problems on an unconfigured machine: Specified adapter name "DS9097U" is not known * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cannot load default adapter. Please check that the adapter is connected and that no other application is using the port. If you have checked the adapter, the default port might not be selected. Either set the value of the TMEX default using the utility provided with the TMEX Runtime, or create a new file in the /lib folder called onewireviewer.properties with two lines, similar to the following: #native win32 drivers adapter.name={DS9097U} adapter.port=COM1 #or javax.comm drivers adapter.name=DS9097U adapter.port=COM1 The full path to this file should be: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/onewireviewer.properties ---- Wow, that is a show stopper! Configuration is something that we really need to think about as an automatic thing, particularly for web start users. You can't ask a person who wants to run an application to figure out how to alter a properties file. If you know you need one, then get permission and make one...automatically. That makes a lot of sense, to me. Basically, we need an installer. At the very least, all the pre-built binaries and jars needed for the RXTX package on several platforms should be available from a single place. One this happens, we can make a JNLP file that is platform specific, but can give us a level of indirection. Is this something that has been done already? Thanks! - Doug From taj at www.linux.org.uk Thu Jun 30 08:10:22 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 15:10:22 +0100 (BST) Subject: [Rxtx] tools In-Reply-To: References: Message-ID: On Thu, 30 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I have been thinking about automatic cross-platform > native method development of Java/C programs. > > It appears that different binary tools are needed to target different > platforms. Configuration seems a bit painful. > > Is there something better available than make? > > Is ANT any good at this? I'm far from an Ant expert but have used it for other projects. The main problem I see with ant is there is no mainstream support for platform neutral neutral library creation as far as I can tell. I think ant is a fine replacement for make but I've not seen a suitable replacement for autoconf. At that point, make is as good as anything. It should be possible to create a ant build.xml that works on say Solaris, Linux, Windows and Mac OS X. The problem is when you are trying to build a library for embeded ARM from Mac OS X. > Has anyone tried: > http://jnipp.sourceforge.net/ -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:22:02 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:22:02 +0100 (BST) Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <1119689424.12606.14.camel@BPC0276> References: <1119689424.12606.14.camel@BPC0276> Message-ID: On Sat, 25 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I am trying to get RXTX to work on Fedora Core, version 3 or 4. > > I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 > directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext > directory. > > I have edited the jre/lib/javax.comm.properties according to the docs. > > I have tried this with both rxtx 2.0 and 2.1. > > I have tried on two different machines. > > I have tried with java 1.4.2 and java 1.5.0, both from Sun. > > I always get a signall 11 from the native libraries when they are > loaded. Is this a common problem? Any help is greatly appreciated. > Below is the start of the error message. More can be supplied on > demand. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x65015A > Function=(null)+0x65015A > Library=/lib/ld-linux.so.2 > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) If you compile rxtx from source, this will probably go away. I'm not sure what the exact cause is but it looks like the binaries are not suitable for FC3/4. The ABI may have changed since those had been compiled. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:26:56 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:26:56 +0100 (BST) Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError In-Reply-To: <42C13666.9030108@blueyonder.co.uk> References: <42C13666.9030108@blueyonder.co.uk> Message-ID: tOn Tue, 28 Jun 2005, Christopher Harris wrote: > Hi > > I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 > 32bit) > > The serial ports work fine with no issues, but when i try to use the > parallel port i get this message > > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:66) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) > > > I am trying to print a line out to port "/dev/lp0" > > At first i thought it could not find the librxtxParallel.so file, but > when i renamed it i got a different saying it could not find the library. > > I have tried to run as root no difference. > > It is really weird, i get no compile errors and the serial ports work fine. > > I changed the LPRPort.java and commented out the Initialize call method. > And just get the same error but for the method open. > > It is as though it can't see the methods, and yet it can see the library. > I did have a bit of check of the JNI implementation in rxtx but could > not spot anything. > > > You can check if the symbols are in the shared library: nm librxtxSerial.so |grep Initialize If the symbols are not there, there was a build error. Watch very close for build errors while compiling from source. I suspect something isnt behaving right. -- Trent Jarvi tjarvi at qbang.org From allen at adbyrne.us Thu Jun 30 06:55:58 2005 From: allen at adbyrne.us (Allen Byrne) Date: Thu, 30 Jun 2005 07:55:58 -0500 Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> References: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> Message-ID: <200506300755.59159.allen@adbyrne.us> On Thursday 30 June 2005 00:31, rxtx-request at mail.electronpusher.org wrote: > >Message: 8 >Date: Sat, 25 Jun 2005 10:50:24 +0200 >From: Uwe Kubosch >Subject: [Rxtx] RXTX in FC3/FC4 >To: rxtx at mail.electronpusher.org >Message-ID: <1119689424.12606.14.camel at BPC0276> >Content-Type: text/plain > >Hi all! > >I am trying to get RXTX to work on Fedora Core, version 3 or 4. > >I have tried this with both rxtx 2.0 and 2.1. > >I have tried on two different machines. > >I have tried with java 1.4.2 and java 1.5.0, both from Sun. > >I always get a signall 11 from the native libraries when they are >loaded. ?Is this a common problem? ?Any help is greatly appreciated. >Below is the start of the error message. ?More can be supplied on >demand. > >An unexpected exception has been detected in native code outside the VM. >Unexpected Signal : 11 occurred at PC=0x65015A >Function=(null)+0x65015A >Library=/lib/ld-linux.so.2 > I had thi same problem on SUSE9.3 and java 1.5.0. After searching through the archives, I found a patch that required adding a sleep(1000) command in two functions of SerialIO.java. This only was for rxtx2.1, I had no trouble with rxtx2.0. Note, also I had to add the "|1.5*" sequence to the configure.in file to get good *.so libs. Again 2.0 was fine. -- Allen Byrne adbyrne at ieee.org http://modelrr.adbyrne.us From taj at www.linux.org.uk Fri Jun 3 01:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 08:57:29 +0100 (BST) Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 3 09:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 16:57:53 +0100 (BST) Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi at qbang.org From jasmine at electronpusher.org Fri Jun 3 10:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 17:12:21 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 11:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:02:09 +0100 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 11:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:05:10 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From jon.nall at gmail.com Mon Jun 6 09:13:58 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 10:13:58 -0500 Subject: [Rxtx] StackOverflowError Message-ID: I have a fairly small application that is communicating to a microcontroller programmer at 115.2k. I have a test where I try and dump the memory of the microcontroller (whose size is 8k and change). Things are going smoothly and the data looks good. Then after reading out ~6.5k of data, I get a StackOverflowError. The stack trace looks like: CommInterface.serialEvent(): 324 // this is my code RXTXPort.sendEvent(): 732 RXTXPort.eventLoop() [Native] MonitorThread.run(): 1531 I am running on windows and using rxtx-2.1-CVS-20050120. When I increased the stack size to 512k, I could read the entire chip without issue. But that doesn't seem like the right thing to do without root causing what's happening. My code doesn't include any recursion and the stack trace looks terribly short, so I'm a bit confused as to why I'm getting a StackOverflowError. CommInterface.serialEvent() does little more than grab the available bytes, enter a synchronized block, stick them in a common data area for the main thread to use and leave the synchronization block. I guess my question is: are there any known issues with the default stack size when using the latest rxtx on windows? thanks, nall. From taj at www.linux.org.uk Mon Jun 6 09:27:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 16:27:34 +0100 (BST) Subject: [Rxtx] StackOverflowError In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > I have a fairly small application that is communicating to a > microcontroller programmer at 115.2k. I have a test where I try and > dump the memory of the microcontroller (whose size is 8k and change). > Things are going smoothly and the data looks good. Then after reading > out ~6.5k of data, I get a StackOverflowError. The stack trace looks > like: > > CommInterface.serialEvent(): 324 // this is my code > RXTXPort.sendEvent(): 732 > RXTXPort.eventLoop() [Native] > MonitorThread.run(): 1531 > > I am running on windows and using rxtx-2.1-CVS-20050120. When I > increased the stack size to 512k, I could read the entire chip without > issue. But that doesn't seem like the right thing to do without root > causing what's happening. My code doesn't include any recursion and > the stack trace looks terribly short, so I'm a bit confused as to why > I'm getting a StackOverflowError. > > CommInterface.serialEvent() does little more than grab the available > bytes, enter a synchronized block, stick them in a common data area > for the main thread to use and leave the synchronization block. > > I guess my question is: are there any known issues with the default > stack size when using the latest rxtx on windows? > This is the first I've heard of the problem. It is strange as you mention lookin at the stack trace. That cant be taking up too much space. If you just toss the data instead of trying to put it in your work area, does it persist? -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Mon Jun 6 10:09:39 2005 From: lengyel at gmail.com (FL) Date: Mon, 6 Jun 2005 12:09:39 -0400 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on which the jdk1.5.0_03 is installed. I found that the INSTALL documentation seems to be in error. It states that javacomm20-x86.tar.Z (the Java Communications API for Solaris/x86) must be used, in fact this choice led to the following test with theBlackBox sample program in the commapi: root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG BlackBox -p /dev/ttyS0 Port /dev/ttyS0 not found! No serial ports found! Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to cause Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to the Eclipse stable build version 3.1M7 to avoid this. However, I found that using the Solaris/Sparc version of commapi worked on my system. I have documented this on: http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050606/b28fb9a7/attachment-0005.html From taj at www.linux.org.uk Mon Jun 6 10:30:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:30:27 +0100 (BST) Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, FL wrote: > I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on > which the jdk1.5.0_03 is installed. I found that the INSTALL documentation > seems to be in error. It states that javacomm20-x86.tar.Z (the Java > Communications API for Solaris/x86) must be used, in fact this choice led to > the following test with theBlackBox sample program in the commapi: > > root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG > BlackBox -p /dev/ttyS0 > Port /dev/ttyS0 not found! > No serial ports found! > > Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to > cause > Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to > the Eclipse stable build version 3.1M7 to avoid this. > > However, I found that using the Solaris/Sparc version of commapi > worked on my system. > > I have documented this on: > > http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 > Thanks FL. I'll change the documentation to point to the SPARC comm.jar. In the past, any Solaris was good enough, we tried to avoid the w32 comm.jar because it made native calls rxtx would never implement on any OS as they are not platform neutral. I'll withold comments about Sun's comm.jar being different on various CPUs within even the same OS. RXTX 2.1 does not need to do that even acrossed OSs for instance. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 6 10:35:43 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 11:35:43 -0500 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API Message-ID: It seems that Sun's javax.comm site does not include JavaDoc'ed API and the RxTx site has the API, but no real documentation. Is there some site that i'm just missing in my google searches? I'm looking for a copy of the javax.comm API which is documented. Thanks, nall. From taj at www.linux.org.uk Mon Jun 6 10:44:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:44:03 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > It seems that Sun's javax.comm site does not include JavaDoc'ed API > and the RxTx site has the API, but no real documentation. Is there > some site that i'm just missing in my google searches? I'm looking for > a copy of the javax.comm API which is documented. > > Thanks, > nall. Sun's version is with their binary downloads. RXTX tries to match that so I never bothered with more complete JavaDocs. Whatever Sun documents is what we try to do. -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Mon Jun 6 12:13:44 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 6 Jun 2005 14:13:44 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: Message-ID: <20050606181245.528C929D56F@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Trent Jarvi > Sent: Monday, June 06, 2005 12:44 PM > To: Jon Nall; Java RXTX discussion > Subject: Re: [Rxtx] Where can I find JavaDoc on the javax.comm API > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > It seems that Sun's javax.comm site does not include JavaDoc'ed API > > and the RxTx site has the API, but no real documentation. Is there > > some site that i'm just missing in my google searches? I'm > looking for > > a copy of the javax.comm API which is documented. > > > > Thanks, > > nall. > > Sun's version is with their binary downloads. RXTX tries to > match that so I never bothered with more complete JavaDocs. > Whatever Sun documents is what we try to do. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Try http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht ml -Ack From gadelavega at yahoo.com.ar Mon Jun 6 12:58:09 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Mon, 6 Jun 2005 15:58:09 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606181245.528C929D56F@mail.electronpusher.org> Message-ID: <20050606185809.57069.qmail@web14603.mail.yahoo.com> --- "David S. Acker" escribi?: > > -----Original Message----- > > From: rxtx-bounces at mail.electronpusher.org > > [mailto:rxtx-bounces at mail.electronpusher.org] On > Behalf Of Trent Jarvi > > Sent: Monday, June 06, 2005 12:44 PM > > To: Jon Nall; Java RXTX discussion > > Subject: Re: [Rxtx] Where can I find JavaDoc on > the javax.comm API > > > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > > > It seems that Sun's javax.comm site does not > include JavaDoc'ed API > > > and the RxTx site has the API, but no real > documentation. Is there > > > some site that i'm just missing in my google > searches? I'm > > looking for > > > a copy of the javax.comm API which is > documented. > > > > > > Thanks, > > > nall. > > > > Sun's version is with their binary downloads. > RXTX tries to > > match that so I never bothered with more complete > JavaDocs. > > Whatever Sun documents is what we try to do. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > Try > http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > ml > -Ack > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > I'm prety sure it was there... but not anymore. Gonzalo A. de la Vega, BI ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From taj at www.linux.org.uk Mon Jun 6 18:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 01:09:14 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606185809.57069.qmail@web14603.mail.yahoo.com> References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: >> http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > > I'm prety sure it was there... but not anymore. > It is there. Maybe the URL got mangled. Try this http://tinyurl.com/8dfp7 It just redirects you to: http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.html -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 7 05:46:39 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Jun 2005 07:46:39 -0400 Subject: [Rxtx] rxtx under fedora - odd procedures Message-ID: Hi All, I was able to get RXTX communications to work under Fedora, but only after I added myself to the UUCP and LOCK groups, logged out and then logged back in. Both groups appear to be needed in order to access the serial ports. Also the group alter did not take until after I logged out and logged back in. My theory is that you need permission to write to the var/spool directory under fedora and that this is the only way to do it. Logging out and logging back in just seems like an odd thing to do. I suppose some users may have to restart X. Ouch! Is this true? The alter_group command indicates that you need to be an su to alter the group database. Does this mean that my serial port users need a database su able person to use serial port applications under RXTX? If so, what is the procedure to make a transparent install work using Java web start? Should I be prompting users for the su password? Should I be telling users to exit from X and log out? Is this the way other serial communications programs work? Thanks! - Doug From sean_montgomery at baseview.com Tue Jun 7 08:14:51 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 7 Jun 2005 10:14:51 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: >>> http://java.sun.com/products/javacomm/javadocs/javax/comm/package- >>> summary.ht >>> > > >> >> I'm prety sure it was there... but not anymore. >> >> > > It is there. Maybe the URL got mangled. Try this > > http://tinyurl.com/8dfp7 > > It just redirects you to: > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > summary.html > Maybe the issue here is that the info is available without frames from that URL, but when you try to access it with frames (from the link on that page) it doesn't work - it takes you to: http://java.sun.com/products/javacomm/javadocs/index.html Which doesn't have anything useful on it. From gadelavega at yahoo.com.ar Tue Jun 7 08:22:50 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:22:50 -0300 (ART) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: Message-ID: <20050607142251.92850.qmail@web14626.mail.yahoo.com> --- "Dr. Douglas Lyon" escribi?: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the > group > alter did not take until after I logged out and > logged back in. > > My theory is that you need permission to write to > the var/spool > directory under fedora and that this is the only way > to do it. > > Logging out and logging back in just seems like an > odd thing to > do. I suppose some users may have to restart X. > Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port > applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log > out? > Is this the way other serial communications programs > work? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Actually, you need the lock group to acces /var/lock directory, and uucp to acces /dev/ttyS*. You (as root) shuold add all users you will allow to use the serial ports to group uucp and all the ones you'll allow to lock the ports to lock group (rxtx needs both). This is not only for rxtx, but for any use of the serial ports. Next time they login they'll be able to work, so if they are in they'll have to log out first. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From gadelavega at yahoo.com.ar Tue Jun 7 08:23:56 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:23:56 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> Message-ID: <20050607142356.93815.qmail@web14624.mail.yahoo.com> --- Sean Montgomery escribi?: > > On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: > > >>> > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > >>> summary.ht > >>> > > > > > >> > >> I'm prety sure it was there... but not anymore. > >> > >> > > > > It is there. Maybe the URL got mangled. Try this > > > > http://tinyurl.com/8dfp7 > > > > It just redirects you to: > > > > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > > summary.html > > > > Maybe the issue here is that the info is available > without frames > from that URL, but when you try to access it with > frames (from the > link on that page) it doesn't work - it takes you > to: > > http://java.sun.com/products/javacomm/javadocs/index.html > > Which doesn't have anything useful on it. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > That's right, my bad. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From jon.nall at gmail.com Tue Jun 7 08:33:40 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 09:33:40 -0500 Subject: [Rxtx] performance expectations Message-ID: Hi all. I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC microcontroller. The protocol I'm using (which I didn't create) looks like this for the section of code I'm concerned with: PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data PIC -> PC: 0x01 // ACK 0xNN // First 8 bits of data 0xMM // Second 8 bits of data I issue ~2000 of these Read commands. The PIC itself has an input fifo which can store 18 bytes, so I can have 18 read commands in flight at a given time. The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k 8N1. I am measuring the time it takes to perform these 2000 commands at around 30 seconds, which is much longer than I anticipated. With the link fully utilized, I expected: Time per byte transmitted: 115200 / 8 = 14400 bytes/second = ~70 uS/byte Time per response transmitted: ~70 uS/byte * 3 bytes/response = ~210 uS/response Time for 2000 responses to be transmitted: ~210 uS/response * 2000 responses = ~420ms I'm a bit new to this, so I may have made some bad asumptions, but I would have expected a time of a couple of seconds to perform the 2000 reads, not 30+ seconds. I'm obviously missing something here. Can someone help me understand what's going on? Thanks, nall. From taj at www.linux.org.uk Tue Jun 7 09:17:48 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:17:48 +0100 (BST) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the group > alter did not take until after I logged out and logged back in. > > My theory is that you need permission to write to the var/spool > directory under fedora and that this is the only way to do it. > > Logging out and logging back in just seems like an odd thing to > do. I suppose some users may have to restart X. Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log out? > Is this the way other serial communications programs work? > RIght now, rxtx requires you do one of two things. 1) Use lock files (recommended). This requires intervention by the root users to allow users to create lock files and open the ports as you note. 2) configure rxtx with --disable-lockfiles. In this case you need only worry about the permissions on /dev/ttyS* I'm not sure what the default on Fedora is with respect to permisions. This is not very attractive. There is a better way it could be done on Fedora. Fedora comes with lockdev library. I've been considering this for some time. We could use that for the locking and do away with many of the problems. The problem is embeded devices running Linux do not come with liblockdev. But for your use, I would consider adding a new option for locking serial devices using liblockdev. lockdev-devel has a man page with further information. SYNOPSIS #include pid_t dev_testlock( const char * devname); pid_t dev_lock( const char * devname); pid_t dev_relock( const char * devname, pid_t pid); pid_t dev_unlock( const char * devname, pid_t pid); cc [ flag ... ] file ... -llockdev [ library ] This would probably need to be a configure time option to prevent problems on embeded Linux devices but could otherwise be the default on Linux. I could toss a quick patch together if this is confusing. It is actually easier than what rxtx does now. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 09:27:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:27:11 +0100 (BST) Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > Hi all. > I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC > microcontroller. The protocol I'm using (which I didn't create) looks like this > for the section of code I'm concerned with: > > PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data > PIC -> PC: 0x01 // ACK > 0xNN // First 8 bits of data > 0xMM // Second 8 bits of data > > I issue ~2000 of these Read commands. The PIC itself has an input fifo which > can store 18 bytes, so I can have 18 read commands in flight at a given time. > The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k > 8N1. > > I am measuring the time it takes to perform these 2000 commands at around 30 > seconds, which is much longer than I anticipated. With the link fully utilized, > I expected: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte > > Time per response transmitted: > ~70 uS/byte * 3 bytes/response = ~210 uS/response > > Time for 2000 responses to be transmitted: > ~210 uS/response * 2000 responses = ~420ms > > I'm a bit new to this, so I may have made some bad asumptions, but I would have > expected a time of a couple of seconds to perform the 2000 reads, not 30+ > seconds. > > I'm obviously missing something here. Can someone help me understand what's > going on? > I've hooked rxtx in loopback with a scope in the past at 9600 baud (baud rate is not important). Using event notification and just writing a byte on event/read the latencey was around 8-12 ms. The JNI is not an efficient way to use native code - especially for bit banging. So if timing is critical you want to move some of the logic into the native code rather than banging over the JNI. 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your performance. C# has advantages here. If you move your logic into the native layer or use gcj (rxtx will work with that too) most of your latency should vanish. You may have to play with some sleeps in eventLoop at that point to get full native efficiency. With gcj all of rxtx becomes 'native code' as java is just treated as a subset of C++. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 09:38:51 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 10:38:51 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: On 6/7/05, Jon Nall wrote: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte of course that should be divided by 10 to account for the start/stop bits, but it barely changes the end results. From carobizar at free.fr Tue Jun 7 10:21:29 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 7 Jun 2005 18:21:29 +0200 Subject: [Rxtx] (no subject) Message-ID: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Hello ! I am a french student and I have to create an application able to read and write on serial and parallel port and to run on Windows and Linux. For the moment my program run on Windows thanks the Java Communication API (version for Microsoft Windows and Solaris/x86). But it doesn't work on Linux. Does a recent version of an installation documentation exist ? I didn't find one on the RXTX site (nothing for the windows installation and the linux installation deals with a "jcl.jar" that I don't know...). So, I have some questions : 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 version or Linux&w32 version ?) What are the differences between them ? Which of them are the most stable ? 2) Where have I to put the .so and .dll files ? 3) What have I to write on the file javax.comm.properties ? 4) Have I to delete the file win32comm.dll included in the Java Comm API ? 5) Have I to keep both comm.jar and RXTXcomm.jar ? Best regards, Caroline. From debief at telemsa.com Tue Jun 7 10:44:56 2005 From: debief at telemsa.com (DEBIEF Eric) Date: Tue, 7 Jun 2005 18:44:56 +0200 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: <200506071844.56656.debief@telemsa.com> Hi, We are "pushing" RxTx /Java here in a half-duplex link. The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC and application handling) about 25?s/byte. The figures are the barely the same on two environments. Environment 1 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Linux 2.6.3, Mdk 10.0. RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : bytes are lost on the wire. I need to investigate this mystery.... Java : 1.4.2-rc1 Blackdown Environment 2 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Windows 2000 Pro RxTx : 2.0.7. Java : 1.4.2_08 SUN I Hope this help, Eric. _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 7 11:05:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:05:45 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, DEBIEF Eric wrote: > Hi, > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. How many write() calls is this? > > Environment 1 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Linux 2.6.3, Mdk 10.0. > RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : > bytes are lost on the wire. I need to investigate this mystery.... > Java : 1.4.2-rc1 Blackdown > > Environment 2 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Windows 2000 Pro > RxTx : 2.0.7. > Java : 1.4.2_08 SUN > In my event/read/write test I found windows was ~20% faster than linux for some reason (strange part is Windows was in VMWare on the same Linux machine). It was about the same rxtx version. There are many problems with rxtx 1.4 with respect to commapi on windows but its code paths are more simple. What some people want from rxtx is perhaps better served by hacking up the very first release as they just want to read and write which is what rxtx was before Sun released commapi. It sounds like perhaps you are pushing out larger writes which will greatly improve results. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 11:16:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:16:49 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118161289.42a5c989cf6a2@imp4-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: On Tue, 7 Jun 2005 carobizar at free.fr wrote: > > Hello ! > > I am a french student and I have to create an application able to read and write > on serial and parallel port and to run on Windows and Linux. > For the moment my program run on Windows thanks the Java Communication API > (version for Microsoft Windows and Solaris/x86). > But it doesn't work on Linux. > > Does a recent version of an installation documentation exist ? > I didn't find one on the RXTX site (nothing for the windows installation and the > linux installation deals with a "jcl.jar" that I don't know...). > > So, I have some questions : > > 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 > version or Linux&w32 version ?) What are the differences between them ? Which > of them are the most stable ? > Use rxtx 2.0 with commapi for sparc solaris from Sun. If you want your current package javax.comm. > 2) Where have I to put the .so and .dll files ? On Linux just use the source, the configure script will do all of that for you. tar -xzvf rxtx-2.0-version mkdir rxtx-2.0-version/build cd rxtx-2.0-version/build ../configure && make install It will do everything for you. With Windows, you need to create the javax.comm.properties and install the DLL on your path. But you can just use Sun's package too. They are intended to be interchangable. > > 3) What have I to write on the file javax.comm.properties ? Driver=gnu.io.RXTXCommDriver More documentation in INSTALL that comes with the source. Sun's documentation should work too. configure does this for you on Linux. > > 4) Have I to delete the file win32comm.dll included in the Java Comm API ? > No > 5) Have I to keep both comm.jar and RXTXcomm.jar ? > Yes. RXTX 2.1 replaces comm.jar but the package is different (gnu.io) to avoid contaminating Sun's namespace. With rxtx 2.0 you need Sun's comm.jar - they work together. > > Best regards, > Caroline. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Tue Jun 7 12:07:34 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 14:07:34 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 Message-ID: <20050607180632.1543A29D5C8@mail.electronpusher.org> Hello, I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our product includes a built in USB to Serial adapter so that when it is connected to your PC over USB, it appears as a serial port. We had problems with Sun's comm library because it did not detect serial ports coming and going properly. I did run into a few issues with RxTx though. I am building under Windows (we support XP and 2000) under cygwin. I used a simple make file for the c code that works under cygwin and ant to build the java stuff. Attached is a diff file. The patches hit the following issues: ParallelImp.c - I am not using config so there is no config.h for me. Also, gcc didn't like a local file (win32termios.h) getting included with <> . RXTXPort.java - You can get an exception during the writeByte, writeArray, nativeDrain, readByte, read, readArray, readTerminatedArray, and nativeAvailable calls. Without this patch the IOLocked count gets stuck incremented. termios.c - If you try to open a port through CreateFile and get ERROR_ACCESS_DENIED it means someone else is using the port. We need to make sure to use serial_close instead of just close. I found that some devices finish their I/O synchronously. The code was treating this as an error. I also added some checking on the ClearError calls. I found a compile error when debugging is turned on (see the usleep change). SerialImp.c - Again, I don't have a config.h and again we must use quotes and not <> to include win32termios.h . I also commented out a report call since it seems to happen constantly on my system. Feel free to use these in any way that you want or just to ignore them. Thanks! -Dave Acker dacker at nomadio.net Software Engineer Nomadio, Inc. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diffs.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/5671d159/diffs-0005.txt From jon.nall at gmail.com Tue Jun 7 12:28:16 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 13:28:16 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, DEBIEF Eric wrote: > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. Hi. This is helpful, thanks. I can think of 2 reasons I'm not collecting the data as fast as I think I should be: 1) the device to PC connection is not at 100% utilization 2) my SerialPortEventListener processing has too much overhead Are there other explanations I might be missing as to why it takes so long to transfer the data? Thanks. nall. From taj at www.linux.org.uk Tue Jun 7 13:21:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:21:46 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > On 6/7/05, DEBIEF Eric wrote: > > We are "pushing" RxTx /Java here in a half-duplex link. > > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > > and application handling) about 25?s/byte. > > The figures are the barely the same on two environments. > > Hi. > This is helpful, thanks. I can think of 2 reasons I'm not collecting > the data as fast as I think I should be: > 1) the device to PC connection is not at 100% utilization > 2) my SerialPortEventListener processing has too much overhead > > Are there other explanations I might be missing as to why it takes so > long to transfer the data? > Polling the port would probably make more sense. You can set the threshold/timeouts to avoid racing and not deal with the event notification. As mentioned earlier I think the event latency is ~10ms. Keep the event listener around, rxtx 2.* does not close well without it. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 13:27:27 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 14:27:27 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, Trent Jarvi wrote: > Polling the port would probably make more sense. You can set the > threshold/timeouts to avoid racing and not deal with the event > notification. As mentioned earlier I think the event latency is ~10ms. Trent, Thanks for the response. Just to make sure I understand what you're talking about, when you say event latency, do you mean the time it takes from when the byte hits the PC's comm port to when rxtx presents it to user code? So if the link is 100% utilized, will my user code see "hiccups" or a steady stream of data? Thanks for helping a serial port newbie. nall. From dacker at nomadio.net Tue Jun 7 13:32:20 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 15:32:20 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <20050607193118.5499329CAA0@mail.electronpusher.org> Some folks asked about the make file and ant steps. I have JAVA_HOME set as follows: $ echo $JAVA_HOME C:\Program Files\Java\jdk1.5.0_01 I have all the code in rxtx/src put into gnu/io . The make file here doesn't have optimizations turned on. We have not tested with it yet. --------------Begin Makefile------------------ CPPFLAGS="-I$(JAVA_HOME)/include" "-I$(JAVA_HOME)/include/win32" SOBJECTS=SerialImp.o fuserImp.o termios.o fixup.o init.o POBJECTS=ParallelImp.o termios.o init.o DLLS=rxtxParallel.dll rxtxSerial.dll all: $(CLASSES) $(DLLS) rxtxSerial.dll: $(SOBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(SOBJECTS) rxtxParallel.dll: $(POBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(POBJECTS) clean: rm -fv $(SOBJECTS) $(POBJECTS) $(DLLS) %.o: %.c gcc -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< %.o: %.cpp g++ -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< --------------End Makefile------------------ Here is the ant target I use to build the rxtx libs. Our build puts the class files in a bin dir. We copy the dlls to a deploy dir and to the build dir. Eclipse seems to like the dlls in the build dir. The deploy dir is used when we build our full package. --------------Begin Ant Section------------------ --------------End Ant Section------------------ > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > David S. Acker > Sent: Tuesday, June 07, 2005 2:08 PM > To: 'Java RXTX discussion' > Subject: [Rxtx] Patches to 2.1-7pre17 > > Hello, > I am using RxTx with the Nomadio Sensor, > http://www.nomadio.net/ . Our product includes a built in > USB to Serial adapter so that when it is connected to your PC > over USB, it appears as a serial port. We had problems with > Sun's comm library because it did not detect serial ports > coming and going properly. > > I did run into a few issues with RxTx though. I am building > under Windows (we support XP and 2000) under cygwin. I used > a simple make file for the c code that works under cygwin and > ant to build the java stuff. Attached is a diff file. The > patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h > for me. Also, gcc didn't like a local file (win32termios.h) > getting included with <> . > > RXTXPort.java - You can get an exception during the > writeByte, writeArray, nativeDrain, readByte, read, > readArray, readTerminatedArray, and nativeAvailable calls. > Without this patch the IOLocked count gets stuck incremented. > > termios.c - If you try to open a port through CreateFile and > get ERROR_ACCESS_DENIED it means someone else is using the > port. We need to make sure to use serial_close instead of > just close. I found that some devices finish their I/O > synchronously. The code was treating this as an error. I > also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we > must use quotes and not <> to include win32termios.h . I > also commented out a report call since it seems to happen > constantly on my system. > > Feel free to use these in any way that you want or just to > ignore them. > Thanks! > > -Dave Acker > dacker at nomadio.net > Software Engineer > Nomadio, Inc. > From taj at www.linux.org.uk Tue Jun 7 13:37:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:37:45 +0100 (BST) Subject: [Rxtx] Re: Stack Smashing Attack In-Reply-To: <200506072012.48860.ferdinand.tatzig@web.de> References: <200506072012.48860.ferdinand.tatzig@web.de> Message-ID: On Tue, 7 Jun 2005, Ferdinand Tatzig wrote: > Dear Trent > > I am using RXTX for serial port communication between a PC and a payment > transaction terminal. > When I run my application under Windows 2000, an i386-Linux or an i386-FreeBSD > it works as I expect it to do. However, when I start it to run on AMD64 > machine with a 64-bit Gentoo Linux, the VM terminates with the following > error: > > Port found: /dev/ttyS0 > java: stack smashing attack in function configure_port() > > I am using a 64-bit Blackdown-1.4.2-01 VM. > > I have searched the internet but have found no information about this error. > > This is the code of the method which initializes the serial port: > > /** > * initializes a serial port for communication with a terminal; only > * accessible within this class > * > * @param communication > * @param serialPortToBeInitialized > * @param tillInterfaceEventListener > */ > private TillInterfaceSerialPort(Communication communication, > String serialPortToBeInitialized, > TillInterfaceEventListener tillInterfaceEventListener) > throws IOException, PortInUseException, > TillInterfaceSerialPortNotFoundException, > TooManyListenersException, UnsupportedCommOperationException { > serialPortName = "not initialized yet"; > CommPortIdentifier portId = null; > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > boolean portFound = false; > String temporarySerialPortName = "not initialized yet"; > > // look for a serial port > while (portList.hasMoreElements() && !portFound) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > temporarySerialPortName = portId.getName(); > if (temporarySerialPortName.equals(serialPortToBeInitialized)) { > System.out.print("Port found: "); > System.out.println(temporarySerialPortName); > serialPortName = temporarySerialPortName; > portFound = true; > } > } > } > if (portFound) { > > // initialize the found port - this command causes the VM to terminate > serialPort = (SerialPort) portId > .open( > TillInterfaceConstants.APPLICATION_NAME, > TillInterfaceConstants > .TIMEOUT_IN_MILLISECONDS_FOR_OPENING_OF_COMMUNICATION_PORT); > > // add an event listener which listens > // on the serial port and notifies the > // serial port object when input bytes > // have been received at the port > serialPort.addEventListener(tillInterfaceEventListener); > serialPort.notifyOnDataAvailable(true); > > // initialize the physical layer > // parameters of the serial port > serialPort.setSerialPortParams(TillInterfaceConstants.BAUD_RATE, > SerialPort.DATABITS_8, SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > // set the inter-character > // timeout (T2) > serialPort > .enableReceiveTimeout(TillInterfaceConstants.INTERCHARACTER_TIMEOUT_IN_MILLISECONDS); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > } else > throw new TillInterfaceSerialPortNotFoundException(); > } > > Any hint to solve this problem would be kindly appreciated. > The only thing that comes to mind here after looking at the offending function is rxtx used to include asm/termios.h but now we moved to termios.h and had glibc fix their headers. The asm/termios.h caused problems as its termios was smaller than the actual termios. This should be fixed in current rxtx versions but you can just glance at SerialImp.c and make sure it does not include asm/termios.h. I've cc'd the rxtx mail list because there was one other mention of stack problems recently. I have used rxtx on opteron systems with success. I have a bug I'm trying hard to reproduce on suse 64 bit (circa linux 2.4.19) systems though. So far I have not been able to reproduce the bug. That said, with gentoo... I like gentoo but I seriously doubt they do any QA with their kernel and Java. I've seen problems before. If you use gentoo and have Java problems, at least stick to Linus (that is an s there) kernels while using Java. I'm not an expert on gentoo but I've seen patches go into experimental kernels that turn out to break java and are reverted before going to Linus just before I see problems with gentoo on this list. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:16:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:16:14 +0100 (BST) Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: On Tue, 7 Jun 2005, David S. Acker wrote: > Hello, > I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our > product includes a built in USB to Serial adapter so that when it is > connected to your PC over USB, it appears as a serial port. We had problems > with Sun's comm library because it did not detect serial ports coming and > going properly. > > I did run into a few issues with RxTx though. I am building under Windows > (we support XP and 2000) under cygwin. I used a simple make file for the c > code that works under cygwin and ant to build the java stuff. Attached is a > diff file. The patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h for me. Also, > gcc didn't like a local file (win32termios.h) getting included with <> . > > RXTXPort.java - You can get an exception during the writeByte, writeArray, > nativeDrain, readByte, read, readArray, readTerminatedArray, and > nativeAvailable calls. Without this patch the IOLocked count gets stuck > incremented. > > termios.c - If you try to open a port through CreateFile and get > ERROR_ACCESS_DENIED it means someone else is using the port. We need to > make sure to use serial_close instead of just close. I found that some > devices finish their I/O synchronously. The code was treating this as an > error. I also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we must use quotes > and not <> to include win32termios.h . I also commented out a report call > since it seems to happen constantly on my system. > > Feel free to use these in any way that you want or just to ignore them. > Thanks! > Hi Dave These patches look great as is. Thanks. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:33:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:33:16 +0100 (BST) Subject: [Rxtx] Patch to IOLocked (fwd) Message-ID: This appears to be another solution to the locking. Chris, the other option just moves the locking into the finally clause which I think would be a little cleaner though I'm posting this patch to so people can comment. -- Trent Jarvi tjarvi at qbang.org ---------- Forwarded message ---------- Date: Wed, 1 Jun 2005 13:01:32 +0100 From: Christopher Dawes To: taj at www.linux.org.uk Subject: Patch to IOLocked Do you want me to check it out of CVS and then submit changes? Christopher -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXPort.java.diff Type: application/octet-stream Size: 6965 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/c442f9fc/RXTXPort.java-0005.obj From Christopher.Dawes at retail-logic.com Wed Jun 8 00:57:24 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 8 Jun 2005 07:57:24 +0100 Subject: [Rxtx] Patch to IOLocked (fwd) [Virus Checked] In-Reply-To: Message-ID: Agreed, much better Java :-) Thanks Christopher ------------------------------------------- Consultant Engineer Retail Logic Limited Fleet GU51 3TZ Tel: +44 (0)1252 644377 Mob: +44 (0)7899 842759 Fax: +44 (0)1252 776708 rxtx-bounces at mail.electronpusher.org wrote on 07/06/2005 21:33:16: > > This appears to be another solution to the locking. Chris, the other > option just moves the locking into the finally clause which I think would > be a little cleaner though I'm posting this patch to so people can > comment. > > -- > Trent Jarvi > tjarvi at qbang.org > > ---------- Forwarded message ---------- > Date: Wed, 1 Jun 2005 13:01:32 +0100 > From: Christopher Dawes > To: taj at www.linux.org.uk > Subject: Patch to IOLocked > > Do you want me to check it out of CVS and then submit changes? > > Christopher[attachment "RXTXPort.java.diff" deleted by Chris > Dawes/Retaillogic/NISABA] _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx From zempftman at gmail.com Wed Jun 8 07:57:25 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 09:57:25 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Maxwell Zempftman Date: May 27, 2005 5:01 PM Subject: Re: [Rxtx] Kaffe & rxtx & armv5b To: rxtx at mail.linuxgrrls.org Here are the results from working this week: The "NullPointerExceptions" are generated by the software when I choose a bad device file. I discovered that this occurs on the i686-RedHat box as well. This exception seems to be generated only by this particular application, and not by the example programs in contrib. So, for example: java MyApp /dev/null <-- generates NullPointerException java MyApp fake <-- generates NullPointerException java MyApp /dev/ttyS0 <-- does not generate NullPointerException Using the program CommCheck (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it appears as though /dev/ttyS0 is the only valid serial device file on the XScale device, so the errors I was getting are not really be bugs. Although /dev/ttyS0 did not generate NullPointerExceptions, I did encounter this error: --start java MyApp /dev/ttyS0 (going mostly from memory, not exact) PortList.hasMoreElements: true Listening on: /dev/ttyS0 Client connected. >From net: echo kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 vmExcept_setJNIFrame Assert: on 'fp != 0' failed. --end I took a look at exception.h, and it seems as though the problematic code does not exist in newer versions of Kaffe (I have been using CVS-2004-11). Next week I will try to use a newer version, although so far everything but CVS-2004-11 has failed. Also, I the device files I need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with something like this? Thanks, Max. > On 5/21/05, Trent Jarvi wrote: > > I'm not sure what is wrong in the first part. It sounds like your > > application may be swallowing an exception while trying to enumerate the > > port or open it. The usual mistake made it not having permissions to > > either open the port or create the lockfile. There should be examples in > > the contrib directory you can try that enumerate and open ports. Maybe > > that will give you some hints. > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > Sun's code limiting you there though you do need to compile and install > > rxtx for the XScale with Sun's Commapi. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > From taj at www.linux.org.uk Wed Jun 8 08:22:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 15:22:44 +0100 (BST) Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > ---------- Forwarded message ---------- > From: Maxwell Zempftman > Date: May 27, 2005 5:01 PM > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > To: rxtx at mail.linuxgrrls.org > > > Here are the results from working this week: > > The "NullPointerExceptions" are generated by the software when I > choose a bad device file. I discovered that this occurs on the > i686-RedHat box as well. This exception seems to be generated only by > this particular application, and not by the example programs in > contrib. So, for example: > > java MyApp /dev/null <-- generates NullPointerException > java MyApp fake <-- generates NullPointerException > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > Using the program CommCheck > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > appears as though /dev/ttyS0 is the only valid serial device file on > the XScale device, so the errors I was getting are not really be bugs. > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > encounter this error: > > --start > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > PortList.hasMoreElements: true > Listening on: /dev/ttyS0 > Client connected. > >From net: echo > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > --end > > I took a look at exception.h, and it seems as though the problematic > code does not exist in newer versions of Kaffe (I have been using > CVS-2004-11). Next week I will try to use a newer version, although so > far everything but CVS-2004-11 has failed. Also, I the device files I > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > something like this? > In RXTXCommDriver, just look for the following code and add /dev/ttyM to the list. Moxa? if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } So: if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyM", // for Moxa ports "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } Linux just has way too many port types to try enumerating them all. There is potential we can add them back in with udev now. > Thanks, > Max. > > > On 5/21/05, Trent Jarvi wrote: > > > I'm not sure what is wrong in the first part. It sounds like your > > > application may be swallowing an exception while trying to enumerate the > > > port or open it. The usual mistake made it not having permissions to > > > either open the port or create the lockfile. There should be examples in > > > the contrib directory you can try that enumerate and open ports. Maybe > > > that will give you some hints. > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > Sun's code limiting you there though you do need to compile and install > > > rxtx for the XScale with Sun's Commapi. > > > > > > -- > > > Trent Jarvi > > > tjarvi at qbang.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Wed Jun 8 12:16:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 08 Jun 2005 13:16:03 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A60B8D.8080500@cs.umn.edu> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> Message-ID: <42A735E3.8040706@atcorp.com> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual serial comport. This isn't so much of a problem, what is, however, is that the comport does not appear to be able to be set to any arbitrary speed, only those from the data_rate enum. I've not found much on using different speeds, has anyone else encountered anything similar? I greatly appreciate any and all comments and suggestions. Thanks in advance, ~ Shawn Lavelle From zempftman at gmail.com Wed Jun 8 12:50:58 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 14:50:58 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: Thanks Trent! That will solve one of the problems. I don't know when my next chance to work on it will be, but I still need to figure out the error I got when I tried opening '/dev/ttyS0' on the Moxa device regarding a failed assertion, seemed to be a Kaffe issue. Thanks for you help, hope to have results soon, Max Englander. On 6/8/05, Trent Jarvi wrote: > On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > > > ---------- Forwarded message ---------- > > From: Maxwell Zempftman > > Date: May 27, 2005 5:01 PM > > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > > To: rxtx at mail.linuxgrrls.org > > > > > > Here are the results from working this week: > > > > The "NullPointerExceptions" are generated by the software when I > > choose a bad device file. I discovered that this occurs on the > > i686-RedHat box as well. This exception seems to be generated only by > > this particular application, and not by the example programs in > > contrib. So, for example: > > > > java MyApp /dev/null <-- generates NullPointerException > > java MyApp fake <-- generates NullPointerException > > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > > > Using the program CommCheck > > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > > appears as though /dev/ttyS0 is the only valid serial device file on > > the XScale device, so the errors I was getting are not really be bugs. > > > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > > encounter this error: > > > > --start > > > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > > > PortList.hasMoreElements: true > > Listening on: /dev/ttyS0 > > Client connected. > > >From net: echo > > > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > > > --end > > > > I took a look at exception.h, and it seems as though the problematic > > code does not exist in newer versions of Kaffe (I have been using > > CVS-2004-11). Next week I will try to use a newer version, although so > > far everything but CVS-2004-11 has failed. Also, I the device files I > > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > > something like this? > > > > > In RXTXCommDriver, just look for the following code and add /dev/ttyM to > the list. Moxa? > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > So: > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyM", // for Moxa ports > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > Linux just has way too many port types to try enumerating them all. There > is potential we can add them back in with udev now. > > > > > Thanks, > > Max. > > > > > On 5/21/05, Trent Jarvi wrote: > > > > I'm not sure what is wrong in the first part. It sounds like your > > > > application may be swallowing an exception while trying to enumerate the > > > > port or open it. The usual mistake made it not having permissions to > > > > either open the port or create the lockfile. There should be examples in > > > > the contrib directory you can try that enumerate and open ports. Maybe > > > > that will give you some hints. > > > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > > Sun's code limiting you there though you do need to compile and install > > > > rxtx for the XScale with Sun's Commapi. > > > > > > > > -- > > > > Trent Jarvi > > > > tjarvi at qbang.org > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- > Trent Jarvi > tjarvi at qbang.org > From taj at www.linux.org.uk Wed Jun 8 12:53:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 19:53:10 +0100 (BST) Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A735E3.8040706@atcorp.com> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: On Wed, 8 Jun 2005, Shawn Lavelle wrote: > Hello, > I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate > with a virtual serial comport. This isn't so much of a problem, what > is, however, is that the comport does not appear to be able to be set to > any arbitrary speed, only those from the data_rate enum. I've not found > much on using different speeds, has anyone else encountered anything > similar? I greatly appreciate any and all comments and suggestions. > This problem is a bit more tricky than it should be. POSIX systems just have a few specified baud rates. Solaris is one of these systems. CommAPI baud rates probably came from someone looking at Solaris. RXTX tries to be POSIX like. W32 is treated as a POSIX like system via a termios.c file in rxtx. Serial ports have baudbase and divisor. So you can set these to come close to the baudrate you want. Some funky equipment like automobile test equipment use baud rates that are not really possible with PC hardware. But if you get as close as possible by changing baud base and divisor, it works. Windows can actually do this for you. I don't know exactly what their code does but if you pass a baudrate to windows, it will guestimate a baudbase and divisor. So you just pass it 10200 baud and it does its job. This is not of very much use the way rxtx does things though. Linux has the standard POSIX like baud rates but if you set the baud rate to B38400, you can set your own baud base and divisor. This is not POSIX that I know of. W32 has more capability than POSIX like systems too. So I did some work to have windows work like Linux via termios.c But the code is not quit right. SerialImp.c and termios.c need some work so all the various buadrates work on Linux and W32. Most other systems will not work beyond what CommAPI already specifies without writting kernel drivers. This is on my todo list but if someone gets to it first, all the better. -- Trent Jarvi tjarvi at qbang.org From carobizar at free.fr Thu Jun 9 06:39:10 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Thu, 9 Jun 2005 14:39:10 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: <1118320750.42a8386e6d3ce@imp5-q.free.fr> Hi ! Thank you for all your advices. I managed to use rxtx on Windows but I have still some difficulties on Linux. I have yet follow your instructions and the configure file has created : - librxtxSerial.so and librxtxParallel.so in the directory /usr/java/j2sdk1.4.2_08/jre/lib/i386 - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the directory /usr/java/j2sdk1.4.2_08/jre/lib - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext But when I run my program, Some exceptions occur : Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver So, 1) What have I forgotten ? 2) Is it possible to make my application run on Linux without the jdk (only the jre) ? Best regards, Caroline. From taj at www.linux.org.uk Thu Jun 9 07:28:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 9 Jun 2005 14:28:05 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118320750.42a8386e6d3ce@imp5-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: On Thu, 9 Jun 2005 carobizar at free.fr wrote: > Hi ! > Thank you for all your advices. > I managed to use rxtx on Windows but I have still some difficulties on Linux. > I have yet follow your instructions and the configure file has created : > - librxtxSerial.so and librxtxParallel.so in the directory > /usr/java/j2sdk1.4.2_08/jre/lib/i386 > - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the > directory /usr/java/j2sdk1.4.2_08/jre/lib > - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext > > But when I run my program, Some exceptions occur : > Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while > loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > com.sun.comm.SolarisDriver > > So, > 1) What have I forgotten ? > The native (.so) libraries are not installed in a directory the JRE is looking for native libraries in. You may look around and see where the .so libraries are in the JRE. I don't know that the jre/lib/i386 directory is specified as a required directory for JREs. I noticed some do not use it. You may try printing the java.libarary.path to see your options. It is also possible to alter the java.library.path. > 2) Is it possible to make my application run on Linux without the jdk (only the > jre) ? Yes. Though installation from source with the JDK is less error prone. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0005.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 7 15:03:09 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 07 Jun 2005 16:03:09 -0500 Subject: [Rxtx] Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <42A60B8D.8080500@cs.umn.edu> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual comport. This isn't so much of a problem, what is, however, is that the comport is only ever set to 9600 baud. I've not found this as a documented bug, has anyone else encountered anything similar? I'll try and provide more detail tomorrow, but if anyone has any suggestions or encountered this before, I'd like to hear about it. Thanks in advance, ~ Shawn Lavelle From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0005.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0005.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0005.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Mon Jun 20 01:04:40 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 20 Jun 2005 08:04:40 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: <42B66A88.4060806@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050620/9be208a1/attachment-0005.html From fbalzarro at libero.it Mon Jun 20 02:33:52 2005 From: fbalzarro at libero.it (Fabio Balzarro) Date: Mon, 20 Jun 2005 10:33:52 +0200 Subject: [Rxtx] RXTXPort:close detected bad file descriptor Message-ID: I'm using RXTX libraries on IPAQ 4150 PDA with Windows CE 4.20 and Jeode. When I close a serial port with sp.close() (where sp is a SerialPort) sometimes an error occour 1119256168085: RXTXPort:close detected bad file descriptor What can I do? Thanks Fabio ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From slavelle at atcorp.com Mon Jun 20 08:08:19 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 20 Jun 2005 09:08:19 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: <42B6CDD3.4040409@atcorp.com> It turns out that I did have a driver-not-used issue which has now been resolved and I can use RxTx on it (had to add ttyUSB as a valid port), but only at standard baud rates. Does USB have the same restrictions on port speed as regular RS232? ~ Shawn Trent Jarvi wrote: > Just a note here. > > I have requested a FTDI usb device and they offered to send one for the > purpose of trying to get rxtx working. I have no idea how long that takes > though. > > > On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > > >>I'm afraid we're just using the latest version from the FTDI website. I've >>not yet played with linux properly with this and unfortunately I run gentoo >>and haven't yet successfully compiled in the ftdi driver. I'll let you know >>if I get any success. >> >>Appologies >> >>Christopher >> >>-----Original Message----- >>From: rxtx-bounces at mail.electronpusher.org >>[mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle >>Sent: 15 June 2005 00:00 >>To: Java RXTX discussion >>Subject: Re: [Rxtx] Virtual Com Ports >> >>Hmm, the latter sounds like a lot of work. It does find the virtual comport >>in windows, i must have just missed it earlier (sign of a long day). On the >>linux side, I suspect that something is not correct with the driver >>installation becuase it does not give me a tty for it :( >> >>Christopher, May I ask what driver you are using for your FTDI chip? >>Did you ever encounter problems with not getting a tty assigned for it? >> >> >> Thanks for all your help! >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>They will have to show up as a tty device in Linux. Probably ttyUSB? >>>That will need an entry in RXTXCommDriver.java. If they dont show up >>>as a tty device, rxtx cant treat it like a serial port. It just wont >> >>work. >> >>>With COM3, rxtx will try to open the port and perform a timed out read. >>>Usually if a port is not there, the read blows up or the open blows up. >>>Timing out is fine. COM3 used to share interrupts with COM1. I know >>>you can reassign ports in XP. RXTX scans up through COM255. You may >>>try moving it. >>> >>> >>>The code in question is the following in RXTXCommDriver.java >>> >>> >>> if(osName.equals("Linux")) >>> { >>> String[] Temp = { >>> "ttyS", // linux Serial Ports >>> "ttySA", // for the IPAQs >>> "ttyUSB" // for USB frobs >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>> else if(osName.toLowerCase().indexOf("windows") != -1 ) >>> { >>> String[] Temp = { >>> "COM" // win32 serial ports >>> //"//./COM" // win32 serial ports >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>>If COM3 can be read, it should be found. the ttyUSB should work if >>>thats in the version of RXTXCommDriver.java you have. >>> >>>If this is still a problem, it may be that the driver is erroring on >>>what may be considered normal comm port operations such as setting the >>>speed, timeout, threshold, .. One would have to start looking at each >>>function called in the native open() and read(). >>> >>> >>> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>>seems to find the device using rxtx. Looking at the hardware >>>>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>>>linux. I can't seem to get it to show up as a tty(s#) in linux which >>>>is probably just due to my lack of significant linux knowledge. >>>> >>>> ~ Shawn >>>> >>>>Trent Jarvi wrote: >>>> >>>> >>>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>Has anyone here noticed that virtual comports do not get enumerated >>>>>>via CommPortIdentifier.getPortIdentifiers()?? >>>>>> >>>>>>The device I'm trying to talk to uses an fdti usb to serial >>>>>>convertor with a driver that has it show up as a virtual comport. I >>>>>>can enter this port manually and it will be usable but I cannot get >>>>>>it show up automatically (as in the simple serial demo). Any thoughts >> >>on this? >> >>>>> >>>>>Hi Shawn, >>>>> >>>>>What OS is this and what is the name of the virtual port you are >>>>>trying to open? I suspect the name just needs to be added to >> >>RXTXCommDriver.java. >> >>>>_______________________________________________ >>>>Rxtx mailing list >>>>Rxtx at mail.electronpusher.org >>>>http://www.electronpusher.org/mailman/listinfo/rxtx >>>> >>> >>> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From lyon at docjava.com Mon Jun 20 15:06:08 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 20 Jun 2005 17:06:08 -0400 Subject: [Rxtx] testing Message-ID: Hi All, I am testing my new multi-platform Java Webstart RXTX application (Trent: I could not have done it without you!). So far, I think it will work under Linux (x86), Windows XP, Windows 2000 and MacOS X. The application is available as a Java webstart application at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Edit:Preferences: SerialPort Setup... should bring up a dialog box that enables dialing via the modem. Generally, it does not find internal modems (except on the mac). Why, I don't know. Thanks in advance for trying this new app. All feedback on it is welcome. - Doug Lyon From jasmine at electronpusher.org Tue Jun 21 04:15:53 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Tue, 21 Jun 2005 11:15:53 +0100 Subject: [Rxtx] testing In-Reply-To: References: Message-ID: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > Hi All, > I am testing my new multi-platform Java Webstart RXTX application > (Trent: I could not have done it without you!). > > So far, I think it will work under Linux (x86), Windows XP, > Windows 2000 and MacOS X. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. -J. From taj at www.linux.org.uk Tue Jun 21 05:50:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 12:50:23 +0100 (BST) Subject: [Rxtx] testing In-Reply-To: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> References: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> Message-ID: On Tue, 21 Jun 2005, Jasmine Strong wrote: > > On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > > > Hi All, > > I am testing my new multi-platform Java Webstart RXTX application > > (Trent: I could not have done it without you!). > > > > So far, I think it will work under Linux (x86), Windows XP, > > Windows 2000 and MacOS X. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > on my Mac. > passing -source 1.3 -target 1.3 to javac will compile classes without this problem. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 10:19:25 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 11:19:25 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. Sincerely, Jeremyah Payne From ricardo.trindade at emation.pt Tue Jun 21 13:25:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 20:25:00 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B8698C.2060509@emation.pt> Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > From taj at www.linux.org.uk Tue Jun 21 13:39:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:39:43 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <42B8698C.2060509@emation.pt> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> <42B8698C.2060509@emation.pt> Message-ID: It looks like he has an rs422 device/converter. This is not the problematic 'trying to do protocol X with a serial port' situation unless I'm missing something. I'll follow up with the other email I started. On Tue, 21 Jun 2005, Ricardo Trindade wrote: > Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. > > Payne, Jeremyah L (N-CIM) wrote: > > >Good morning, my name is Jeremyah and I am working on a java project to > >interface with some devices. In short, I have a laptop with a PCMIA > >converter that does RS422 running windows 2000. I also will be > >installing some PCI cards into some Linux boxes that will have probably > >4-8 RS422 ports on them. After doing some reading in order to talk > >with these items using my existing java code I will need an additional > >driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > >trying to get a map sort of where I need to make changes. As I see it, > >I would need to subclass SerialPort to my RS422 interface. That would > >link with a DLL or SO implementation that talks with the hardware. I > >also need to change the listing of working ports in the lookup section > >for serial. Does this seem like I am on the right track? Appreciate > >the support. > > > > > >Sincerely, > >Jeremyah Payne > >_______________________________________________ > >Rxtx mailing list > >Rxtx at mail.electronpusher.org > >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 21 13:40:25 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:40:25 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: On Tue, 21 Jun 2005, Payne, Jeremyah L (N-CIM) wrote: > Good morning, my name is Jeremyah and I am working on a java project to > interface with some devices. In short, I have a laptop with a PCMIA > converter that does RS422 running windows 2000. I also will be > installing some PCI cards into some Linux boxes that will have probably > 4-8 RS422 ports on them. After doing some reading in order to talk with > these items using my existing java code I will need an additional > driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > trying to get a map sort of where I need to make changes. As I see it, I > would need to subclass SerialPort to my RS422 interface. That would link > with a DLL or SO implementation that talks with the hardware. I also > need to change the listing of working ports in the lookup section for > serial. Does this seem like I am on the right track? Appreciate the > support. > Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 13:40:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 14:40:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618954@emss02m08.us.lmco.com> I'd like to except I am dealing with NASA. I am basically building a system to monitor 100+ Units that communicate over RS422. They have some converters in place but want to get rid of them. I'll check through the archives. I had started looking yesterday as was leaving work. -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Ricardo Trindade Sent: Tuesday, June 21, 2005 2:25 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From slavelle at atcorp.com Tue Jun 21 14:58:06 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 21 Jun 2005 15:58:06 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: <42B87F5E.4000403@atcorp.com> > Linux has the standard POSIX like baud rates but if you set the baud rate > to B38400, you can set your own baud base and divisor. This is not POSIX > that I know of. W32 has more capability than POSIX like systems too. So > I did some work to have windows work like Linux via termios.c > > But the code is not quit right. SerialImp.c and termios.c need some > work so all the various buadrates work on Linux and W32. Most other > systems will not work beyond what CommAPI already specifies without > writting kernel drivers. > > This is on my todo list but if someone gets to it first, all the better. Hmm, I guess I didn't read this close enough before. Just to be clear, the pieces to setBaudBase and setDivisor are not yet implemented, correct? Thanks, Shawn From sean_montgomery at baseview.com Tue Jun 21 15:14:08 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 21 Jun 2005 17:14:08 -0400 Subject: [Rxtx] OS X installation - file locations Message-ID: <8AB82C7F-0D19-45F9-AE54-A12C59A8495E@baseview.com> Greetings, I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) using the RXTX installation instructions. RXTX worked fine. Basically you've got: - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions - javax.comm.properties in /System/Library/Frameworks/ JavaVM.framework/Home/lib - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ lib/ext My coworker was concerned that the installation required files to be placed in /System/Library... because those directories are "Apple's" and subject to change at Apple's whim, and that it would be safer (less likely to break when a user updates their OS or Java version or what have you) if all the files could be somewhere in /Library... or / Library/Java. My coworker points out that when 3rd party apps like FrontBase and JBoss need to communicate with Java their jars are placed in /Library/Java/Extensions. Granted that RXTX 2.0 is implementing javax.comm and not just a 3rd party extension, might that be the case - that javax.* stuff needs to be in the Java system files? I'm not the Java maven that my coworker is, so I don't know if any of this is gospel or not. Any OS X/Java experts out there willing to comment? We'd like to be able to install RXTX in the safest, most maintenance free way possible, but if there are specific reasons why javax.comm.properties and comm.jar need to be in /System... then so be it. Any information is welcome, Sean From ricardo.trindade at emation.pt Tue Jun 21 15:56:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 22:56:53 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B88D25.7060604@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050621/f6c9f5fe/attachment-0005.html From jeremyah.l.payne at lmco.com Tue Jun 21 15:22:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 16:22:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618955@emss02m08.us.lmco.com> -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Trent Jarvi Sent: Tuesday, June 21, 2005 2:40 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 As of yet we have not decided on the PCI boards to use yet So I am still waiting to se how we will interface to them. But the laptop is ready to use so ill build a test app for that API for now. The overview of class structure is really what I needed. I guess I will use the 2.1 as you suggested. Thanks for the help thus far! BTW, you guys wouldn't happen to keep class diagrams or anything of that nature around would you? If not I will probably end up having to do some anyway for documentation purposes, I could include them. Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From dmarkman at mac.com Tue Jun 21 18:13:28 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 21 Jun 2005 20:13:28 -0400 Subject: [Rxtx] OS X installation - file locations In-Reply-To: References: Message-ID: <044F520C-585C-4B99-82ED-3BA83DB8CE77@mac.com> Apple doesn't recommend to put jars into the /System/Library/Frameworks/JavaVM.framework/Home/lib/ext folder from other hands it's standard java directory to put extentions if you want to support comm api on whole system then I'd recommend to put jars into the /Library/Java/Extensions folder just like you did if you want to support comm api per user put your jars into the ~/ Library/Java/Extensions On Jun 21, 2005, at 5:14 PM, Java RXTX discussion wrote: > Greetings, > > > I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) > using the RXTX installation instructions. RXTX worked fine. > > > Basically you've got: > - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions > - javax.comm.properties in /System/Library/Frameworks/ > JavaVM.framework/Home/lib > - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ > lib/ext > > > My coworker was concerned that the installation required files to be > placed in /System/Library... because those directories are "Apple's" > and subject to change at Apple's whim, and that it would be safer > (less likely to break when a user updates their OS or Java version or > what have you) if all the files could be somewhere in /Library... or / > Library/Java. My coworker points out that when 3rd party apps like > FrontBase and JBoss need to communicate with Java their jars are > placed in /Library/Java/Extensions. Granted that RXTX 2.0 is > implementing javax.comm and not just a 3rd party extension, might > that be the case - that javax.* stuff needs to be in the Java system > files? > > > I'm not the Java maven that my coworker is, so I don't know if any of > this is gospel or not. Any OS X/Java experts out there willing to > comment? We'd like to be able to install RXTX in the safest, most > maintenance free way possible, but if there are specific reasons why > javax.comm.properties and comm.jar need to be in /System... then so > be it. > > > Any information is welcome, > > > Sean > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Dmitry Markman Dmitry Markman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050622/beea65d0/attachment-0005.html From lyon at docjava.com Thu Jun 23 04:39:47 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 23 Jun 2005 06:39:47 -0400 Subject: [Rxtx] web start + RXTX = strange errors? Message-ID: On: Date: Tue, 21 Jun 2005 11:15:53 +0100 From: Jasmine Strong Writes: An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. ----------- I cannot duplicate your error. My version of Java is: java -version java version "1.4.2_05" Is yours the same? Trent: You wrote: passing -source 1.3 -target 1.3 to javac will compile classes without this problem. ----------- OK, I have updated the disto to work with jdk1.3: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Jasmine: Is this working any better? Thanks! - DL From handzisk at tkn.tu-berlin.de Fri Jun 24 02:37:14 2005 From: handzisk at tkn.tu-berlin.de (Vlado Handziski) Date: Fri, 24 Jun 2005 10:37:14 +0200 (CEST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace Message-ID: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Hi all, let me first express my compliments on the great work you have done with the RXTX library. We have been using the library for some time, and we are at a point where we want to make our code public. For legacy reasons, the code that the RXTX library is bundled with, uses the javax.comm namespace. We have been using the ChangePackage script to change the RXTX2.1 package from gnu.io into javax.comm. We need the independent implementation since we want to be able to directly access /dev/ttyUSBx ports in linux and the CommAPI versions are just not as stable. On the download page, there is a comment that this is in violation of sun's license. Can someone shed more light on this. I was not aware that you can protect the names of the java packages. Best regards, Vlado From ricardo.trindade at emation.pt Fri Jun 24 04:01:17 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 11:01:17 +0100 Subject: [Rxtx] parity missed Message-ID: <42BBD9ED.3060004@emation.pt> Hi, I have a "parity missed error". From previous posts I believe this has to do with CMSPAR not being defined. I checked out 2.1 head from CVS. How can I make sure I do a proper build and CMSPAR is defined ? Perhaps it would be good to have a release snapshot that has this, I think the latest snapshot (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. Another question I have, is why must this depend on kernel headers, why can't it be defined in the RXTX source ? thanks Ricardo From jasmine at electronpusher.org Fri Jun 24 04:09:06 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 24 Jun 2005 11:09:06 +0100 Subject: [Rxtx] web start + RXTX = strange errors? In-Reply-To: References: Message-ID: <644aad2bdbba950f0a2fb12d7dcfd8a6@electronpusher.org> On 23 Jun 2005, at 11:39, Dr. Douglas Lyon wrote: > OK, I have updated the disto to work with jdk1.3: > http://show.docjava.com:8086/book/cgij/code/jnlp/ > addbk.JAddressBook.Main.jnlp > > Jasmine: Is this working any better? Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) -J. From taj at www.linux.org.uk Fri Jun 24 10:54:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 17:54:12 +0100 (BST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: On Fri, 24 Jun 2005, Vlado Handziski wrote: > Hi all, > > let me first express my compliments on the great work you have done with > the RXTX library. > > We have been using the library for some time, and we are at a point where > we want to make our code public. For legacy reasons, the code that the > RXTX library is bundled with, uses the javax.comm namespace. We have been > using the ChangePackage script to change the RXTX2.1 package from gnu.io > into javax.comm. We need the independent implementation since we want to > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > versions are just not as stable. > > On the download page, there is a comment that this is in violation of > sun's license. Can someone shed more light on this. I was not aware that > you can protect the names of the java packages. > > Best regards, > Vlado > I can't provide legal advice as I am not a lawyer. (v) may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are contained in the "java", "javax" or "sun" packages or similar as specified by Sun in any class file naming convention; and The license is in the commapi package from Sun. The above is also in all the EULA's you click through to download from Sun if I'm not mistaken. Simply put, the license taints developers that agree to it. For those developers, Sun has control of the javax.comm namespace. It really does not make sense to put rxtx 2.1 in the javax.comm namespace. It will only cause confusion which I think is the point of the clause above. The gnu.io namespace was perhaps a poor choice and just tossed in when reviewing the license to get out of Sun's namespace. There is nothing in the rxtx license limiting your freedom in this fashion though. Many companies are moving to gnu.io and some distribute it with popular applications you would recognize. I'm tempted to ask you not to contaminate rxtx 2.1 with the javax.comm namespace. You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) extensions to existing classes (which I dont think you are using); it is not just javax.comm. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 24 13:24:09 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 20:24:09 +0100 (BST) Subject: [Rxtx] parity missed In-Reply-To: <42BBD9ED.3060004@emation.pt> References: <42BBD9ED.3060004@emation.pt> Message-ID: On Fri, 24 Jun 2005, Ricardo Trindade wrote: > Hi, > > I have a "parity missed error". From previous posts I believe this > has to do with CMSPAR not being defined. > I checked out 2.1 head from CVS. How can I make sure I do a proper > build and CMSPAR is defined ? Perhaps it would be good to have a release > snapshot that has this, I think the latest snapshot > (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. > > Another question I have, is why must this depend on kernel headers, > why can't it be defined in the RXTX source ? > I used to cheat and grab the CMSPAR from the kernel headers because glibc did not have it. Now rxtx uses the glibc headers and we have a patch in glibc I trust that handles this. It would not be right to override glibc and it wasnt right to use the kernel headers (it really did cause problems). You can override glibc for now with the following in the top of SerialImp.c # define CMSPAR 010000000000 You can check if your distro headers have this right bit looking for the above in bits/termios.h. It should look like this: #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif If it is not defined, please file a bug with your distro as rxtx is not the only thing that will be broken on that distro. I was going to release new cvs snapshots last weekend but got tied up. I'll do it this weekend. I also need to get custom baudrate patches into the cvs snapshot. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Fri Jun 24 13:56:50 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 20:56:50 +0100 Subject: [Rxtx] parity missed In-Reply-To: References: <42BBD9ED.3060004@emation.pt> Message-ID: <42BC6582.2070805@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050624/e3b39631/attachment-0005.html From vlado.handziski at gmail.com Sat Jun 25 06:25:52 2005 From: vlado.handziski at gmail.com (Vlado Handziski) Date: Sat, 25 Jun 2005 14:25:52 +0200 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: <697986ec05062505256ebf381f@mail.gmail.com> Thanks for the clarification. Since changing the bundled source is not an option at this moment, we will consider using javax.comm and RXTX2.0. In the next rewrite, we would probably move to gnu.io . Best regards, Vlado Handziski On 6/24/05, Trent Jarvi wrote: > > On Fri, 24 Jun 2005, Vlado Handziski wrote: > > > Hi all, > > > > let me first express my compliments on the great work you have done with > > the RXTX library. > > > > We have been using the library for some time, and we are at a point > where > > we want to make our code public. For legacy reasons, the code that the > > RXTX library is bundled with, uses the javax.comm namespace. We have > been > > using the ChangePackage script to change the RXTX2.1 package from gnu.io > > into javax.comm. We need the independent implementation since we want to > > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > > versions are just not as stable. > > > > On the download page, there is a comment that this is in violation of > > sun's license. Can someone shed more light on this. I was not aware that > > you can protect the names of the java packages. > > > > Best regards, > > Vlado > > > > I can't provide legal advice as I am not a lawyer. > > (v) may not create, or authorize your licensees to create additional > classes, interfaces, or subpackages that are contained in the "java", > "javax" or "sun" packages or similar as specified by Sun in any class file > naming convention; and > > The license is in the commapi package from Sun. The above is also in all > the EULA's you click through to download from Sun if I'm not mistaken. > > Simply put, the license taints developers that agree to it. For those > developers, Sun has control of the javax.comm namespace. > > It really does not make sense to put rxtx 2.1 in the javax.comm namespace. > It will only cause confusion which I think is the point of the clause > above. The gnu.io namespace was perhaps a poor choice and > just tossed in > when reviewing the license to get out of Sun's namespace. > > There is nothing in the rxtx license limiting your freedom in this fashion > though. Many companies are moving to gnu.io and some > distribute it with > popular applications you would recognize. I'm tempted to ask you not > to contaminate rxtx 2.1 with the javax.comm namespace. > > You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm > using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) > extensions to existing classes (which I dont think you are using); it is > not just javax.comm. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050625/1dadc50e/attachment-0005.html From taj at www.linux.org.uk Sun Jun 26 11:34:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 26 Jun 2005 18:34:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. Message-ID: The attached file should fix baud_base and divisor extensions for Linux The patch is against rxtx 2.1 CVS HEAD. To use this patch, you should set the baud rate to 38400. You can then try SerialPort.setBaudBase(int) and SerialPort.setDivisor(int) There are matching int SerialPort.getBaudBase() and int SerialPort.getDivisor(). What baud bases are available depends upon the serial port card and its driver so this is a bit of a blind attempt on my part. I've looked at the w32 API and I dont see anything available yet. The w32 code in RXTX will probably be figuring out the baud rate based on the tried baud base and divisor and just slamming it at the API for now (the API does something with that but I've not found real documentation on what it does). I dont want to try tinkering with the UART directly yet as that would involve poking machine memory directly and could very easily be error prone in bad ways. I don't expect Solaris or any SysV UNIX systems to work at all with this - ever. It is not standard in any way and will throw Exceptions on everything but Linux (w32 will just fail miserably as it is 1/2 implemented). If anyone has looked at custom baud rates before and has some thoughts or just wants to try the attached untested patch, I'd appreciate any feedback. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- ? autom4te.cache ? build ? output cvs server: Diffing . Index: configure =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure,v retrieving revision 1.35.2.59 diff -u -r1.35.2.59 configure --- configure 16 Oct 2004 16:20:34 -0000 1.35.2.59 +++ configure 26 Jun 2005 16:59:28 -0000 @@ -9644,6 +9644,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { #if defined (__GLIBC__) @@ -9782,6 +9784,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { @@ -9825,7 +9829,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -9837,7 +9841,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 26 Jun 2005 16:59:28 -0000 @@ -218,6 +218,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { #if defined (__GLIBC__) @@ -356,6 +358,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { @@ -399,7 +403,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -411,7 +415,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" cvs server: Diffing CNI cvs server: Diffing MACOSX_IDE cvs server: Diffing MACOSX_IDE/CW cvs server: Diffing MACOSX_IDE/ForPackageMaker cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions cvs server: Diffing MACOSX_IDE/ForPackageMaker/Resources cvs server: Diffing MACOSX_IDE/PB cvs server: Diffing WinCE cvs server: Diffing contrib cvs server: Diffing debian cvs server: Diffing src Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 26 Jun 2005 16:59:29 -0000 @@ -2079,15 +2079,17 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int BaudBase The clock frequency divided by 16. Default * BaudBase is 115200. * @return boolean true on success - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:setBaudBase()"); @@ -2097,10 +2099,11 @@ /** * Extension to CommAPI * @return int BaudBase - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getBaudBase() throws UnsupportedCommOperationException + public int getBaudBase() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getBaudBase()"); @@ -2108,13 +2111,14 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, IOException { if ( debug ) z.reportln( "RXTXPort:setDivisor()"); @@ -2124,10 +2128,11 @@ /** * Extension to CommAPI * @returns int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getDivisor() throws UnsupportedCommOperationException + public int getDivisor() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getDivisor()"); Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 26 Jun 2005 16:59:30 -0000 @@ -1877,16 +1877,27 @@ int fd = get_java_var( env, jobj,"fd","I" ); struct serial_struct sstruct; + if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) + { + goto fail; + } + + sstruct.baud_base = (int) BaudBase; + if ( sstruct.baud_base < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetBaudBase", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetBaudBase", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1914,9 +1925,13 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) ( sstruct.baud_base ) ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetBaudBase", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetBaudBase", strerror( errno ) ); @@ -1950,19 +1965,23 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } if ( sstruct.custom_divisor < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetDivisor", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetDivisor", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1971,7 +1990,7 @@ accept: none perform: Find the Divisor used for custom speeds - return: Divisor + return: Divisor negative value on error. exceptions: Unsupported Comm Operation on systems not supporting TIOCGSERIAL comments: @@ -1990,10 +2009,14 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) sstruct.custom_divisor ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetDivisor", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetDivisor", strerror( errno ) ); @@ -2032,7 +2055,7 @@ /* Open and lock the port so nothing else changes the setting */ - if ( LOCK( filename, pid ) ) goto fail;; + if ( LOCK( filename, pid ) ) goto fail; fd = find_preopened_ports( filename ); if( !fd ) Index: src/SerialPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/Attic/SerialPort.java,v retrieving revision 1.3.2.9 diff -u -r1.3.2.9 SerialPort.java --- src/SerialPort.java 12 Oct 2004 08:59:28 -0000 1.3.2.9 +++ src/SerialPort.java 26 Jun 2005 16:59:30 -0000 @@ -103,13 +103,17 @@ public abstract String getUARTType() throws UnsupportedCommOperationException; public abstract boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getBaudBase() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getDivisor() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setLowLatency() throws UnsupportedCommOperationException; public abstract boolean getLowLatency() cvs server: Diffing src/lfd cvs server: Diffing src/psmisc From uwe at kubosch.no Mon Jun 27 14:13:57 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Mon, 27 Jun 2005 22:13:57 +0200 Subject: [Rxtx] RXTX on FC4 Message-ID: <1119903238.2989.27.camel@BPC0276> Hi all! I just got RXTX to work on Fedora Core 4. The standard download did not work. I had to check the code out from CVS and build it, but then it worked flawlessly. Thanks for your good work. Now I wonder if I should contribute the compiled files so that others will have an easier time than me getting RXTX to work on FC4. What do I do? Who do I talk to? donV From taj at www.linux.org.uk Mon Jun 27 14:29:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 27 Jun 2005 21:29:46 +0100 (BST) Subject: [Rxtx] RXTX on FC4 In-Reply-To: <1119903238.2989.27.camel@BPC0276> References: <1119903238.2989.27.camel@BPC0276> Message-ID: On Mon, 27 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I just got RXTX to work on Fedora Core 4. > > The standard download did not work. > > I had to check the code out from CVS and build it, but then it worked > flawlessly. > > Thanks for your good work. > > Now I wonder if I should contribute the compiled files so that others > will have an easier time than me getting RXTX to work on FC4. What do I > do? Who do I talk to? > > The best thing to do with FC is to contibute an extras RPM. Debian does something like this with their .deb packaging. As rxtx is OS neutral, it is almost impossible to have everything on rxtx.org. If you do get a package in Fedora Extras, I can point a link there. The extra's mail list is here: https://www.redhat.com/mailman/listinfo/fedora-extras-list If it would help to have me release a 'stable' .tar.gz of the source for the RPM submittal process I can do that. It would also trigger upgrades in debian which would not be bad. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Mon Jun 27 16:23:20 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 27 Jun 2005 17:23:20 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: Message-ID: <42C07C58.1030608@atcorp.com> Hey Trent, I installed it and now I get IOExceptions instead of the other one. I'm not sure how those changes would have enabled setDivisor and setBaudBase to work though. Is it significant that this is a USB device emulating a serial port? ~ Shawn From taj at www.linux.org.uk Mon Jun 27 18:07:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 01:07:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: <42C07C58.1030608@atcorp.com> References: <42C07C58.1030608@atcorp.com> Message-ID: On Mon, 27 Jun 2005, Shawn Lavelle wrote: > Hey Trent, > I installed it and now I get IOExceptions instead of the other one. > I'm not sure how those changes would have enabled setDivisor and > setBaudBase to work though. Is it significant that this is a USB device > emulating a serial port? > The USB driver probably does not support this. With USB, the ioctl()'s appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through the linux drivers/usb tree and found to ioctl to support this in Linux 2.6.10. RXTX is not doing very much magic, the patch really only gets the serial struct instead of writing a structure with random values for baudbase and handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel level driver issue not a user space library issue. So if you wanted this to work, the usb serial driver would have to handle the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression after looking through the USB tree quickly. I hope that helps. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Jun 27 18:25:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 27 Jun 2005 20:25:22 -0400 Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) Message-ID: Hi All, I wrote: Jasmine: Is this working any better? And Jasmine says: Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) I am using -source 1.3 and -target 1.3 for the compilation, however, we still seem to have this problem, which my machine (for some reason) does not have. Does anyone have any ideas about what might be the problem? Thanks! - DL From taj at www.linux.org.uk Mon Jun 27 19:04:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 02:04:37 +0100 (BST) Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) In-Reply-To: References: Message-ID: On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I wrote: > Jasmine: Is this working any better? > > And Jasmine says: > Nope. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > > I am using -source 1.3 and -target 1.3 > for the compilation, however, we still seem to have this problem, > which my machine (for some reason) does not have. > Does anyone have any ideas about what might be the problem? > This has shown up in the past with jdk 1.5 compiled jars running on jre 1.4 machines. My guess is either jasmine has an old copy of rxtx with the problem on her machine that is being picked up on the classpath or you have not tried this with jre 1.4. The suggested -source/target fix should avoid the problem. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Mon Jun 27 21:23:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 04:23:55 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: On Tue, 28 Jun 2005, Trent Jarvi wrote: > On Mon, 27 Jun 2005, Shawn Lavelle wrote: > > > Hey Trent, > > I installed it and now I get IOExceptions instead of the other one. > > I'm not sure how those changes would have enabled setDivisor and > > setBaudBase to work though. Is it significant that this is a USB device > > emulating a serial port? > > > > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > > RXTX is not doing very much magic, the patch really only gets the serial > struct instead of writing a structure with random values for baudbase and > handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel > level driver issue not a user space library issue. > > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. > > I hope that helps. > > > It may be possible that you can just modify translate_speed and get_java_baudrate in SerialImp.c to have the new high speds you are after. The defines are in /usr/include/termios.h. #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 You can see many of these are not handled. I dont think CommAPI handled more than 57600 or so. int get_java_baudrate( int native_speed ) { switch( native_speed ) { case B0: return 0; case B50: return 50; case B75: return 75; case B110: return 110; case B134: return 134; case B150: return 150; case B200: return 200; case B300: return 300; case B600: return 600; case B1200: return 1200; case B1800: return 1800; case B2400: return 2400; case B4800: return 4800; case B9600: return 9600; case B19200: return 19200; case B38400: return 38400; case B57600: return 57600; default: return -1; } } int translate_speed( JNIEnv *env, jint speed ) { LEAVE( "RXTXPort:translate_speed" ); switch( speed ) { case 0: return B0; case 50: return B50; case 75: return B75; case 110: return B110; case 134: return B134; case 150: return B150; case 200: return B200; case 300: return B300; case 600: return B600; case 1200: return B1200; case 1800: return B1800; case 2400: return B2400; case 4800: return B4800; case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; #ifdef B57600 case 57600: return B57600; #endif /* B57600 */ #ifdef B115200 case 115200: return B115200; #endif /* B115200 */ #ifdef B230400 case 230400: return B230400; #endif /* B230400 */ #ifdef B460800 case 460800: return B460800; #endif /* B460800 */ #ifdef B14400 case 14400: return B14400; #endif /* B14400 */ #ifdef B28800 case 28800: return B28800; #endif /* B28800 */ #ifdef B128000 /* dima */ case 128000: return B128000; #endif /* dima */ #ifdef B256000 /* dima */ case 256000: return B256000; #endif /* dima */ } /* Handle custom speeds */ if( speed >= 0 ) return speed; else { LEAVE( "RXTXPort:translate_speed: Error condition" ); return -1; } } -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 28 05:20:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 28 Jun 2005 07:20:21 -0400 Subject: [Rxtx] cross-compilation using Make for Mac Message-ID: Hi All, Please excuse the long post; Trent said: >" >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. " Here is what I have on the mac version: java -version java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) When I run: http://show.docjava.com:8086/book/cgij/code/jnlp/math.benchmarks.Dhry.jnlp I get: -- listing properties -- jnlpx.heapsize=NULL,NULL jnlpx.splashport=-1 java.runtime.name=Java(TM) 2 Runtime Environment, Stand... java.protocol.handler.pkgs=com.sun.javaws.net.protocol sun.boot.library.path=/System/Library/Frameworks/JavaVM.fra... java.vm.version=1.4.2-38 awt.nativeDoubleBuffering=true gopherProxySet=false http.auth.serializeRequests=true java.vm.vendor="Apple Computer, Inc." java.vendor.url=http://apple.com/ path.separator=: java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io jnlpx.home=/Applications/Utilities/Java/Java Web... user.country=US sun.os.patch.level=unknown java.vm.specification.name=Java Virtual Machine Specification user.dir=/ java.runtime.version=1.4.2_05-141.4 java.awt.graphicsenv=apple.awt.CGraphicsEnvironment java.endorsed.dirs=/System/Library/Frameworks/JavaVM.fra... os.arch=ppc java.io.tmpdir=/tmp line.separator= java.vm.specification.vendor=Sun Microsystems Inc. jnlpx.remove=false os.name=Mac OS X sun.java2d.fontpath= java.library.path=/Applications/Utilities/Java/Java Web... java.specification.name=Java Platform API Specification java.class.version=48.0 jnlpx.deployment.user.home=/Users/lyon/Library/Caches/Java Web S... java.util.prefs.PreferencesFactory=java.util.prefs.MacOSXPreferencesFactory os.version=10.3.9 user.home=/Users/lyon user.timezone=America/New_York java.security.policy=file:/Applications/Utilities/Java/Jav... java.awt.printerjob=apple.awt.CPrinterJob trustProxy=true java.specification.version=1.4 file.encoding=MacRoman jnlpx.deployment.system.home=/Applications/Utilities/Java/J2SE 5.0... user.name=lyon java.class.path=/Applications/Utilities/Java/Java Web... java.vm.specification.version=1.0 sun.arch.data.model=32 java.home=/System/Library/Frameworks/JavaVM.fra... java.specification.vendor=Sun Microsystems Inc. user.language=en awt.toolkit=apple.awt.CToolkit java.vm.info=mixed mode java.version=1.4.2_05 java.ext.dirs=/Users/lyon/Library/Java/Extensions:/... sun.boot.class.path=/System/Library/Frameworks/JavaVM.fra... java.vendor=Apple Computer, Inc. file.separator=/ java.vendor.url.bug=http://developer.apple.com/java/ sun.cpu.endian=big sun.io.unicode.encoding=UnicodeBig mrj.version=141.3 jnlpx.jvm=/System/Library/Frameworks/JavaVM.fra... sun.cpu.isalist= sun.awt.exception.handler=apple.awt.CToolkit$EventQueueExceptio... javawebstart.version=javaws-1.4.2_05 800 mhz g4,878k ds/sec total time: 1184ms Result: 844594 dhrystone/sec. Load average for last 15 minutes:0.62 So, I feel pretty sure that I have tried this with 1.4. As to modifying the RXTX compilation, that I did not do...and I take your point. I have been using the binary distributions as is. Oops. I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Now when I do a make, I get: make gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known libtool: link: warning: undefined symbols not allowed in i386-pc-mingw32 shared libraries rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ln: `SerialImp.o': File exists make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 So, I do a make clean, then a make: .... (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ar cru .libs/librxtxSerial.a /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o ar: /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o: No such file or directory make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 In the i386 directory, there is a symbolic link left from something: ls -al SerialImp.o lrwxrwxrwx 1 lyon lyon 12 Jun 28 07:03 SerialImp.o -> SerialImp.lo However, the SerialImp.lo is not present (which is the cause of the error, I think). On the other hand, the file I am looking for is present in: i686-pc-linux-gnu Possibly the i386 generation is not clean (of course it is also likely that I am just asking dumb questions, being a newbie to the code and all.). Finally, will this make file regenerate the distro for the mac? I found some really old (from year 2001) files in: cvs/MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions Which I could use for the distro...but I would prefer to do a clean, multi-platform build from make. Thanks! - Doug >On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > >> Hi All, >> I wrote: >> Jasmine: Is this working any better? >> >> And Jasmine says: >> Nope. >> >> An error occurred while launching/running the application. >> >> Title: addbk.JAddressBook.Main >> Vendor: DocJava, Inc. >> Category: Unexpected Error >> >> gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) >> >> > > I am using -source 1.3 and -target 1.3 >> for the compilation, however, we still seem to have this problem, >> which my machine (for some reason) does not have. >> Does anyone have any ideas about what might be the problem? >> > >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. > > >The suggested -source/target fix should avoid the problem. > >-- >Trent Jarvi >tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 28 09:43:41 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 28 Jun 2005 10:43:41 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: <42C1702D.1070307@atcorp.com> > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. There is ioctl stuff in the driver for the chip, but i haven't seen the TIOC*SERIAL entries. That might be why it continues to fail. I did get around the problem, though, by hacking the driver and just specifying the baud rate I need. Now everything works well. Thanks for all the assistance you've provided. ~ Shawn M. Lavelle From taj at www.linux.org.uk Tue Jun 28 12:42:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:42:29 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known Add a compiler flag -DWIN32 The code above should not be compiling on w32 as it is #if !defined(WIN32) You can look at the bottom of Makefile.in to see the w32 compile flags. Search for "WIN32 CrossCompiling from here down" If its still not working, I can set you up with the Bob account. Just email me off the list. W32 compiling is a bit complicated. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 28 12:52:50 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:52:50 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Nods. I did change configure but right now it is only in the baudbase/divisor patch I posted. I'm going to add several extension baud rates that can be supported by normal API calls and commit that today as a followup to my comments yesterday on baudrates. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Wed Jun 29 01:52:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 08:52:10 +0100 (BST) Subject: [Rxtx] [PATCH] More baud rate fixes Message-ID: I went through the native baudrate conversion from Java and added several. This patch is against CVS 2.1 head. I think thats it for baud rate fixes unless someone see something. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- A non-text attachment was scrubbed... Name: baud_base_and_divisor_plus_odd_baudrates.diff.gz Type: application/x-gzip Size: 3291 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050629/4c1ef1c2/baud_base_and_divisor_plus_odd_baudrates.diff-0005.gz From lyon at docjava.com Wed Jun 29 10:33:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 29 Jun 2005 12:33:45 -0400 Subject: [Rxtx] java.comm dependencies Message-ID: Hi All, During a build of the rxtx code, I have left the javax.comm out of the system (on purpose). However, I get an error, at run time: CommPortIdentifier:static initialization() apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: javax/comm/CommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver I am thinking that there is something in the gnu.io.CommPortIdentifier that seeks to load the javax.comm.CommDriver. It was my understanding that we could write code without reference to the javax.comm.CommDriver and that we could work in the gnu namespace. Is this true? Thanks! - Doug From taj at www.linux.org.uk Wed Jun 29 11:16:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 18:16:08 +0100 (BST) Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > During a build of the rxtx code, I have left the > javax.comm out of the system (on purpose). > However, I get an error, at run time: > > CommPortIdentifier:static initialization() > apple.awt.EventQueueExceptionHandler Caught Throwable : > java.lang.NoClassDefFoundError: javax/comm/CommDriver > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > that seeks to load the javax.comm.CommDriver. > > It was my understanding that we could write code without reference > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > Is this true? > Yes. People use 2.1 without javax all the time. There should be no reference to javax at all in rxtx 2.1. You may check your code. I just did a grep through 2.1 and there is nothing. You may look at the classes you are using. If you find javax.comm in your code, replace it with gnu.io and that should be all you need to do. -- Trent Jarvi tjarvi at qbang.org From jayant28k at gmail.com Wed Jun 29 21:49:28 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Thu, 30 Jun 2005 09:19:28 +0530 Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: <6a6a02310506292049778c452f@mail.gmail.com> Trent, I think best idea is to have wiki for rxtx code. So as the traffic is increasing with time. "RXTX" seems to be more popular in embbeded system. Sun Microsystems will always apperciate your efforts on parallel and serial ports commincation based application in IT Industry. Thanks for your help on this forum as "ONE MAN ARMY" ;-) Cheers, Jayant On 6/29/05, Trent Jarvi wrote: > On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > > > Hi All, > > During a build of the rxtx code, I have left the > > javax.comm out of the system (on purpose). > > However, I get an error, at run time: > > > > CommPortIdentifier:static initialization() > > apple.awt.EventQueueExceptionHandler Caught Throwable : > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > > that seeks to load the javax.comm.CommDriver. > > > > It was my understanding that we could write code without reference > > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > > > Is this true? > > > > Yes. People use 2.1 without javax all the time. > > There should be no reference to javax at all in rxtx 2.1. You may check > your code. I just did a grep through 2.1 and there is nothing. You may > look at the classes you are using. > > If you find javax.comm in your code, replace it with gnu.io and that > should be all you need to do. > > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From uwe at kubosch.no Sat Jun 25 02:50:24 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Sat, 25 Jun 2005 10:50:24 +0200 Subject: [Rxtx] RXTX in FC3/FC4 Message-ID: <1119689424.12606.14.camel@BPC0276> Hi all! I am trying to get RXTX to work on Fedora Core, version 3 or 4. I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext directory. I have edited the jre/lib/javax.comm.properties according to the docs. I have tried this with both rxtx 2.0 and 2.1. I have tried on two different machines. I have tried with java 1.4.2 and java 1.5.0, both from Sun. I always get a signall 11 from the native libraries when they are loaded. Is this a common problem? Any help is greatly appreciated. Below is the start of the error message. More can be supplied on demand. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x65015A Function=(null)+0x65015A Library=/lib/ld-linux.so.2 NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) - locked <0xed46f628> (a java.util.Vector) - locked <0xed471708> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xed46ebc0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.InitializeDriver(CommPortIdentifier.java:213) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:248) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:351) at com.jpeterson.x10.module.CM11A.allocate(CM11A.java:1160) at net.sourceforge.cruisecontrol.publishers.X10Publisher.send(X10Publisher.java:182) at net.sourceforge.cruisecontrol.publishers.X10Publisher.turnOff(X10Publisher.java:171) at net.sourceforge.cruisecontrol.publishers.X10Publisher.handleBuild(X10Publisher.java:148) at net.sourceforge.cruisecontrol.publishers.X10Publisher.publish(X10Publisher.java:141) at net.sourceforge.cruisecontrol.Project.publish(Project.java:679) at net.sourceforge.cruisecontrol.Project.build(Project.java:227) at net.sourceforge.cruisecontrol.Project.execute(Project.java:153) at net.sourceforge.cruisecontrol.ProjectWrapper.run(ProjectWrapper.java:66) at java.lang.Thread.run(Thread.java:534) From chris_jh at blueyonder.co.uk Tue Jun 28 05:37:10 2005 From: chris_jh at blueyonder.co.uk (Christopher Harris) Date: Tue, 28 Jun 2005 12:37:10 +0100 Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError Message-ID: <42C13666.9030108@blueyonder.co.uk> Hi I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 32bit) The serial ports work fine with no issues, but when i try to use the parallel port i get this message Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:66) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) I am trying to print a line out to port "/dev/lp0" At first i thought it could not find the librxtxParallel.so file, but when i renamed it i got a different saying it could not find the library. I have tried to run as root no difference. It is really weird, i get no compile errors and the serial ports work fine. I changed the LPRPort.java and commented out the Initialize call method. And just get the same error but for the method open. It is as though it can't see the methods, and yet it can see the library. I did have a bit of check of the JNI implementation in rxtx but could not spot anything. Yours Thankfully Christopher Harris From lyon at docjava.com Thu Jun 30 02:28:09 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 04:28:09 -0400 Subject: [Rxtx] tools Message-ID: Hi All, I have been thinking about automatic cross-platform native method development of Java/C programs. It appears that different binary tools are needed to target different platforms. Configuration seems a bit painful. Is there something better available than make? Is ANT any good at this? Has anyone tried: http://jnipp.sourceforge.net/ Thanks! - Doug From lyon at docjava.com Thu Jun 30 04:11:17 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 06:11:17 -0400 Subject: [Rxtx] javax.comm Message-ID: Hi All, When I load my jar files on a linux box, all is well. However, when I load them on a mac, I get: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver The jar files for the mac are different from the jar files for linux, because recompilation of the native code for the mac has not been easy, for me. As a result, the RXTX jars are tending toward specific versions and platforms. Probably, this is not an ideal situation, but, I suspect, it is common. I have an idea that we could create a single JNLP distro site that we can make reference to that would enable a uniform repository of synchronized signed native methods and jars for RXTX. For example, the one-wire Maxim folks have a real-nice approach where their stuff makes reference to another JNLP file that contains all the stuff we need to make RXTX work. Check it out at: http://www.maxim-ic.com/products/ibutton/software/1wire/OneWireViewer.cfm However, even they have problems on an unconfigured machine: Specified adapter name "DS9097U" is not known * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cannot load default adapter. Please check that the adapter is connected and that no other application is using the port. If you have checked the adapter, the default port might not be selected. Either set the value of the TMEX default using the utility provided with the TMEX Runtime, or create a new file in the /lib folder called onewireviewer.properties with two lines, similar to the following: #native win32 drivers adapter.name={DS9097U} adapter.port=COM1 #or javax.comm drivers adapter.name=DS9097U adapter.port=COM1 The full path to this file should be: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/onewireviewer.properties ---- Wow, that is a show stopper! Configuration is something that we really need to think about as an automatic thing, particularly for web start users. You can't ask a person who wants to run an application to figure out how to alter a properties file. If you know you need one, then get permission and make one...automatically. That makes a lot of sense, to me. Basically, we need an installer. At the very least, all the pre-built binaries and jars needed for the RXTX package on several platforms should be available from a single place. One this happens, we can make a JNLP file that is platform specific, but can give us a level of indirection. Is this something that has been done already? Thanks! - Doug From taj at www.linux.org.uk Thu Jun 30 08:10:22 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 15:10:22 +0100 (BST) Subject: [Rxtx] tools In-Reply-To: References: Message-ID: On Thu, 30 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I have been thinking about automatic cross-platform > native method development of Java/C programs. > > It appears that different binary tools are needed to target different > platforms. Configuration seems a bit painful. > > Is there something better available than make? > > Is ANT any good at this? I'm far from an Ant expert but have used it for other projects. The main problem I see with ant is there is no mainstream support for platform neutral neutral library creation as far as I can tell. I think ant is a fine replacement for make but I've not seen a suitable replacement for autoconf. At that point, make is as good as anything. It should be possible to create a ant build.xml that works on say Solaris, Linux, Windows and Mac OS X. The problem is when you are trying to build a library for embeded ARM from Mac OS X. > Has anyone tried: > http://jnipp.sourceforge.net/ -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:22:02 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:22:02 +0100 (BST) Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <1119689424.12606.14.camel@BPC0276> References: <1119689424.12606.14.camel@BPC0276> Message-ID: On Sat, 25 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I am trying to get RXTX to work on Fedora Core, version 3 or 4. > > I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 > directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext > directory. > > I have edited the jre/lib/javax.comm.properties according to the docs. > > I have tried this with both rxtx 2.0 and 2.1. > > I have tried on two different machines. > > I have tried with java 1.4.2 and java 1.5.0, both from Sun. > > I always get a signall 11 from the native libraries when they are > loaded. Is this a common problem? Any help is greatly appreciated. > Below is the start of the error message. More can be supplied on > demand. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x65015A > Function=(null)+0x65015A > Library=/lib/ld-linux.so.2 > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) If you compile rxtx from source, this will probably go away. I'm not sure what the exact cause is but it looks like the binaries are not suitable for FC3/4. The ABI may have changed since those had been compiled. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:26:56 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:26:56 +0100 (BST) Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError In-Reply-To: <42C13666.9030108@blueyonder.co.uk> References: <42C13666.9030108@blueyonder.co.uk> Message-ID: tOn Tue, 28 Jun 2005, Christopher Harris wrote: > Hi > > I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 > 32bit) > > The serial ports work fine with no issues, but when i try to use the > parallel port i get this message > > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:66) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) > > > I am trying to print a line out to port "/dev/lp0" > > At first i thought it could not find the librxtxParallel.so file, but > when i renamed it i got a different saying it could not find the library. > > I have tried to run as root no difference. > > It is really weird, i get no compile errors and the serial ports work fine. > > I changed the LPRPort.java and commented out the Initialize call method. > And just get the same error but for the method open. > > It is as though it can't see the methods, and yet it can see the library. > I did have a bit of check of the JNI implementation in rxtx but could > not spot anything. > > > You can check if the symbols are in the shared library: nm librxtxSerial.so |grep Initialize If the symbols are not there, there was a build error. Watch very close for build errors while compiling from source. I suspect something isnt behaving right. -- Trent Jarvi tjarvi at qbang.org From allen at adbyrne.us Thu Jun 30 06:55:58 2005 From: allen at adbyrne.us (Allen Byrne) Date: Thu, 30 Jun 2005 07:55:58 -0500 Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> References: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> Message-ID: <200506300755.59159.allen@adbyrne.us> On Thursday 30 June 2005 00:31, rxtx-request at mail.electronpusher.org wrote: > >Message: 8 >Date: Sat, 25 Jun 2005 10:50:24 +0200 >From: Uwe Kubosch >Subject: [Rxtx] RXTX in FC3/FC4 >To: rxtx at mail.electronpusher.org >Message-ID: <1119689424.12606.14.camel at BPC0276> >Content-Type: text/plain > >Hi all! > >I am trying to get RXTX to work on Fedora Core, version 3 or 4. > >I have tried this with both rxtx 2.0 and 2.1. > >I have tried on two different machines. > >I have tried with java 1.4.2 and java 1.5.0, both from Sun. > >I always get a signall 11 from the native libraries when they are >loaded. ?Is this a common problem? ?Any help is greatly appreciated. >Below is the start of the error message. ?More can be supplied on >demand. > >An unexpected exception has been detected in native code outside the VM. >Unexpected Signal : 11 occurred at PC=0x65015A >Function=(null)+0x65015A >Library=/lib/ld-linux.so.2 > I had thi same problem on SUSE9.3 and java 1.5.0. After searching through the archives, I found a patch that required adding a sleep(1000) command in two functions of SerialIO.java. This only was for rxtx2.1, I had no trouble with rxtx2.0. Note, also I had to add the "|1.5*" sequence to the configure.in file to get good *.so libs. Again 2.0 was fine. -- Allen Byrne adbyrne at ieee.org http://modelrr.adbyrne.us From taj at www.linux.org.uk Fri Jun 3 01:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 08:57:29 +0100 (BST) Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 3 09:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 16:57:53 +0100 (BST) Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi at qbang.org From jasmine at electronpusher.org Fri Jun 3 10:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 17:12:21 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 11:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:02:09 +0100 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 11:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:05:10 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From jon.nall at gmail.com Mon Jun 6 09:13:58 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 10:13:58 -0500 Subject: [Rxtx] StackOverflowError Message-ID: I have a fairly small application that is communicating to a microcontroller programmer at 115.2k. I have a test where I try and dump the memory of the microcontroller (whose size is 8k and change). Things are going smoothly and the data looks good. Then after reading out ~6.5k of data, I get a StackOverflowError. The stack trace looks like: CommInterface.serialEvent(): 324 // this is my code RXTXPort.sendEvent(): 732 RXTXPort.eventLoop() [Native] MonitorThread.run(): 1531 I am running on windows and using rxtx-2.1-CVS-20050120. When I increased the stack size to 512k, I could read the entire chip without issue. But that doesn't seem like the right thing to do without root causing what's happening. My code doesn't include any recursion and the stack trace looks terribly short, so I'm a bit confused as to why I'm getting a StackOverflowError. CommInterface.serialEvent() does little more than grab the available bytes, enter a synchronized block, stick them in a common data area for the main thread to use and leave the synchronization block. I guess my question is: are there any known issues with the default stack size when using the latest rxtx on windows? thanks, nall. From taj at www.linux.org.uk Mon Jun 6 09:27:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 16:27:34 +0100 (BST) Subject: [Rxtx] StackOverflowError In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > I have a fairly small application that is communicating to a > microcontroller programmer at 115.2k. I have a test where I try and > dump the memory of the microcontroller (whose size is 8k and change). > Things are going smoothly and the data looks good. Then after reading > out ~6.5k of data, I get a StackOverflowError. The stack trace looks > like: > > CommInterface.serialEvent(): 324 // this is my code > RXTXPort.sendEvent(): 732 > RXTXPort.eventLoop() [Native] > MonitorThread.run(): 1531 > > I am running on windows and using rxtx-2.1-CVS-20050120. When I > increased the stack size to 512k, I could read the entire chip without > issue. But that doesn't seem like the right thing to do without root > causing what's happening. My code doesn't include any recursion and > the stack trace looks terribly short, so I'm a bit confused as to why > I'm getting a StackOverflowError. > > CommInterface.serialEvent() does little more than grab the available > bytes, enter a synchronized block, stick them in a common data area > for the main thread to use and leave the synchronization block. > > I guess my question is: are there any known issues with the default > stack size when using the latest rxtx on windows? > This is the first I've heard of the problem. It is strange as you mention lookin at the stack trace. That cant be taking up too much space. If you just toss the data instead of trying to put it in your work area, does it persist? -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Mon Jun 6 10:09:39 2005 From: lengyel at gmail.com (FL) Date: Mon, 6 Jun 2005 12:09:39 -0400 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on which the jdk1.5.0_03 is installed. I found that the INSTALL documentation seems to be in error. It states that javacomm20-x86.tar.Z (the Java Communications API for Solaris/x86) must be used, in fact this choice led to the following test with theBlackBox sample program in the commapi: root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG BlackBox -p /dev/ttyS0 Port /dev/ttyS0 not found! No serial ports found! Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to cause Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to the Eclipse stable build version 3.1M7 to avoid this. However, I found that using the Solaris/Sparc version of commapi worked on my system. I have documented this on: http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050606/b28fb9a7/attachment-0006.html From taj at www.linux.org.uk Mon Jun 6 10:30:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:30:27 +0100 (BST) Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, FL wrote: > I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on > which the jdk1.5.0_03 is installed. I found that the INSTALL documentation > seems to be in error. It states that javacomm20-x86.tar.Z (the Java > Communications API for Solaris/x86) must be used, in fact this choice led to > the following test with theBlackBox sample program in the commapi: > > root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG > BlackBox -p /dev/ttyS0 > Port /dev/ttyS0 not found! > No serial ports found! > > Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to > cause > Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to > the Eclipse stable build version 3.1M7 to avoid this. > > However, I found that using the Solaris/Sparc version of commapi > worked on my system. > > I have documented this on: > > http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 > Thanks FL. I'll change the documentation to point to the SPARC comm.jar. In the past, any Solaris was good enough, we tried to avoid the w32 comm.jar because it made native calls rxtx would never implement on any OS as they are not platform neutral. I'll withold comments about Sun's comm.jar being different on various CPUs within even the same OS. RXTX 2.1 does not need to do that even acrossed OSs for instance. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 6 10:35:43 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 11:35:43 -0500 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API Message-ID: It seems that Sun's javax.comm site does not include JavaDoc'ed API and the RxTx site has the API, but no real documentation. Is there some site that i'm just missing in my google searches? I'm looking for a copy of the javax.comm API which is documented. Thanks, nall. From taj at www.linux.org.uk Mon Jun 6 10:44:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:44:03 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > It seems that Sun's javax.comm site does not include JavaDoc'ed API > and the RxTx site has the API, but no real documentation. Is there > some site that i'm just missing in my google searches? I'm looking for > a copy of the javax.comm API which is documented. > > Thanks, > nall. Sun's version is with their binary downloads. RXTX tries to match that so I never bothered with more complete JavaDocs. Whatever Sun documents is what we try to do. -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Mon Jun 6 12:13:44 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 6 Jun 2005 14:13:44 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: Message-ID: <20050606181245.528C929D56F@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Trent Jarvi > Sent: Monday, June 06, 2005 12:44 PM > To: Jon Nall; Java RXTX discussion > Subject: Re: [Rxtx] Where can I find JavaDoc on the javax.comm API > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > It seems that Sun's javax.comm site does not include JavaDoc'ed API > > and the RxTx site has the API, but no real documentation. Is there > > some site that i'm just missing in my google searches? I'm > looking for > > a copy of the javax.comm API which is documented. > > > > Thanks, > > nall. > > Sun's version is with their binary downloads. RXTX tries to > match that so I never bothered with more complete JavaDocs. > Whatever Sun documents is what we try to do. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Try http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht ml -Ack From gadelavega at yahoo.com.ar Mon Jun 6 12:58:09 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Mon, 6 Jun 2005 15:58:09 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606181245.528C929D56F@mail.electronpusher.org> Message-ID: <20050606185809.57069.qmail@web14603.mail.yahoo.com> --- "David S. Acker" escribi?: > > -----Original Message----- > > From: rxtx-bounces at mail.electronpusher.org > > [mailto:rxtx-bounces at mail.electronpusher.org] On > Behalf Of Trent Jarvi > > Sent: Monday, June 06, 2005 12:44 PM > > To: Jon Nall; Java RXTX discussion > > Subject: Re: [Rxtx] Where can I find JavaDoc on > the javax.comm API > > > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > > > It seems that Sun's javax.comm site does not > include JavaDoc'ed API > > > and the RxTx site has the API, but no real > documentation. Is there > > > some site that i'm just missing in my google > searches? I'm > > looking for > > > a copy of the javax.comm API which is > documented. > > > > > > Thanks, > > > nall. > > > > Sun's version is with their binary downloads. > RXTX tries to > > match that so I never bothered with more complete > JavaDocs. > > Whatever Sun documents is what we try to do. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > Try > http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > ml > -Ack > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > I'm prety sure it was there... but not anymore. Gonzalo A. de la Vega, BI ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From taj at www.linux.org.uk Mon Jun 6 18:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 01:09:14 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606185809.57069.qmail@web14603.mail.yahoo.com> References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: >> http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > > I'm prety sure it was there... but not anymore. > It is there. Maybe the URL got mangled. Try this http://tinyurl.com/8dfp7 It just redirects you to: http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.html -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 7 05:46:39 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Jun 2005 07:46:39 -0400 Subject: [Rxtx] rxtx under fedora - odd procedures Message-ID: Hi All, I was able to get RXTX communications to work under Fedora, but only after I added myself to the UUCP and LOCK groups, logged out and then logged back in. Both groups appear to be needed in order to access the serial ports. Also the group alter did not take until after I logged out and logged back in. My theory is that you need permission to write to the var/spool directory under fedora and that this is the only way to do it. Logging out and logging back in just seems like an odd thing to do. I suppose some users may have to restart X. Ouch! Is this true? The alter_group command indicates that you need to be an su to alter the group database. Does this mean that my serial port users need a database su able person to use serial port applications under RXTX? If so, what is the procedure to make a transparent install work using Java web start? Should I be prompting users for the su password? Should I be telling users to exit from X and log out? Is this the way other serial communications programs work? Thanks! - Doug From sean_montgomery at baseview.com Tue Jun 7 08:14:51 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 7 Jun 2005 10:14:51 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: >>> http://java.sun.com/products/javacomm/javadocs/javax/comm/package- >>> summary.ht >>> > > >> >> I'm prety sure it was there... but not anymore. >> >> > > It is there. Maybe the URL got mangled. Try this > > http://tinyurl.com/8dfp7 > > It just redirects you to: > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > summary.html > Maybe the issue here is that the info is available without frames from that URL, but when you try to access it with frames (from the link on that page) it doesn't work - it takes you to: http://java.sun.com/products/javacomm/javadocs/index.html Which doesn't have anything useful on it. From gadelavega at yahoo.com.ar Tue Jun 7 08:22:50 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:22:50 -0300 (ART) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: Message-ID: <20050607142251.92850.qmail@web14626.mail.yahoo.com> --- "Dr. Douglas Lyon" escribi?: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the > group > alter did not take until after I logged out and > logged back in. > > My theory is that you need permission to write to > the var/spool > directory under fedora and that this is the only way > to do it. > > Logging out and logging back in just seems like an > odd thing to > do. I suppose some users may have to restart X. > Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port > applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log > out? > Is this the way other serial communications programs > work? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Actually, you need the lock group to acces /var/lock directory, and uucp to acces /dev/ttyS*. You (as root) shuold add all users you will allow to use the serial ports to group uucp and all the ones you'll allow to lock the ports to lock group (rxtx needs both). This is not only for rxtx, but for any use of the serial ports. Next time they login they'll be able to work, so if they are in they'll have to log out first. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From gadelavega at yahoo.com.ar Tue Jun 7 08:23:56 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:23:56 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> Message-ID: <20050607142356.93815.qmail@web14624.mail.yahoo.com> --- Sean Montgomery escribi?: > > On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: > > >>> > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > >>> summary.ht > >>> > > > > > >> > >> I'm prety sure it was there... but not anymore. > >> > >> > > > > It is there. Maybe the URL got mangled. Try this > > > > http://tinyurl.com/8dfp7 > > > > It just redirects you to: > > > > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > > summary.html > > > > Maybe the issue here is that the info is available > without frames > from that URL, but when you try to access it with > frames (from the > link on that page) it doesn't work - it takes you > to: > > http://java.sun.com/products/javacomm/javadocs/index.html > > Which doesn't have anything useful on it. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > That's right, my bad. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From jon.nall at gmail.com Tue Jun 7 08:33:40 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 09:33:40 -0500 Subject: [Rxtx] performance expectations Message-ID: Hi all. I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC microcontroller. The protocol I'm using (which I didn't create) looks like this for the section of code I'm concerned with: PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data PIC -> PC: 0x01 // ACK 0xNN // First 8 bits of data 0xMM // Second 8 bits of data I issue ~2000 of these Read commands. The PIC itself has an input fifo which can store 18 bytes, so I can have 18 read commands in flight at a given time. The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k 8N1. I am measuring the time it takes to perform these 2000 commands at around 30 seconds, which is much longer than I anticipated. With the link fully utilized, I expected: Time per byte transmitted: 115200 / 8 = 14400 bytes/second = ~70 uS/byte Time per response transmitted: ~70 uS/byte * 3 bytes/response = ~210 uS/response Time for 2000 responses to be transmitted: ~210 uS/response * 2000 responses = ~420ms I'm a bit new to this, so I may have made some bad asumptions, but I would have expected a time of a couple of seconds to perform the 2000 reads, not 30+ seconds. I'm obviously missing something here. Can someone help me understand what's going on? Thanks, nall. From taj at www.linux.org.uk Tue Jun 7 09:17:48 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:17:48 +0100 (BST) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the group > alter did not take until after I logged out and logged back in. > > My theory is that you need permission to write to the var/spool > directory under fedora and that this is the only way to do it. > > Logging out and logging back in just seems like an odd thing to > do. I suppose some users may have to restart X. Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log out? > Is this the way other serial communications programs work? > RIght now, rxtx requires you do one of two things. 1) Use lock files (recommended). This requires intervention by the root users to allow users to create lock files and open the ports as you note. 2) configure rxtx with --disable-lockfiles. In this case you need only worry about the permissions on /dev/ttyS* I'm not sure what the default on Fedora is with respect to permisions. This is not very attractive. There is a better way it could be done on Fedora. Fedora comes with lockdev library. I've been considering this for some time. We could use that for the locking and do away with many of the problems. The problem is embeded devices running Linux do not come with liblockdev. But for your use, I would consider adding a new option for locking serial devices using liblockdev. lockdev-devel has a man page with further information. SYNOPSIS #include pid_t dev_testlock( const char * devname); pid_t dev_lock( const char * devname); pid_t dev_relock( const char * devname, pid_t pid); pid_t dev_unlock( const char * devname, pid_t pid); cc [ flag ... ] file ... -llockdev [ library ] This would probably need to be a configure time option to prevent problems on embeded Linux devices but could otherwise be the default on Linux. I could toss a quick patch together if this is confusing. It is actually easier than what rxtx does now. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 09:27:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:27:11 +0100 (BST) Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > Hi all. > I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC > microcontroller. The protocol I'm using (which I didn't create) looks like this > for the section of code I'm concerned with: > > PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data > PIC -> PC: 0x01 // ACK > 0xNN // First 8 bits of data > 0xMM // Second 8 bits of data > > I issue ~2000 of these Read commands. The PIC itself has an input fifo which > can store 18 bytes, so I can have 18 read commands in flight at a given time. > The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k > 8N1. > > I am measuring the time it takes to perform these 2000 commands at around 30 > seconds, which is much longer than I anticipated. With the link fully utilized, > I expected: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte > > Time per response transmitted: > ~70 uS/byte * 3 bytes/response = ~210 uS/response > > Time for 2000 responses to be transmitted: > ~210 uS/response * 2000 responses = ~420ms > > I'm a bit new to this, so I may have made some bad asumptions, but I would have > expected a time of a couple of seconds to perform the 2000 reads, not 30+ > seconds. > > I'm obviously missing something here. Can someone help me understand what's > going on? > I've hooked rxtx in loopback with a scope in the past at 9600 baud (baud rate is not important). Using event notification and just writing a byte on event/read the latencey was around 8-12 ms. The JNI is not an efficient way to use native code - especially for bit banging. So if timing is critical you want to move some of the logic into the native code rather than banging over the JNI. 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your performance. C# has advantages here. If you move your logic into the native layer or use gcj (rxtx will work with that too) most of your latency should vanish. You may have to play with some sleeps in eventLoop at that point to get full native efficiency. With gcj all of rxtx becomes 'native code' as java is just treated as a subset of C++. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 09:38:51 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 10:38:51 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: On 6/7/05, Jon Nall wrote: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte of course that should be divided by 10 to account for the start/stop bits, but it barely changes the end results. From carobizar at free.fr Tue Jun 7 10:21:29 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 7 Jun 2005 18:21:29 +0200 Subject: [Rxtx] (no subject) Message-ID: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Hello ! I am a french student and I have to create an application able to read and write on serial and parallel port and to run on Windows and Linux. For the moment my program run on Windows thanks the Java Communication API (version for Microsoft Windows and Solaris/x86). But it doesn't work on Linux. Does a recent version of an installation documentation exist ? I didn't find one on the RXTX site (nothing for the windows installation and the linux installation deals with a "jcl.jar" that I don't know...). So, I have some questions : 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 version or Linux&w32 version ?) What are the differences between them ? Which of them are the most stable ? 2) Where have I to put the .so and .dll files ? 3) What have I to write on the file javax.comm.properties ? 4) Have I to delete the file win32comm.dll included in the Java Comm API ? 5) Have I to keep both comm.jar and RXTXcomm.jar ? Best regards, Caroline. From debief at telemsa.com Tue Jun 7 10:44:56 2005 From: debief at telemsa.com (DEBIEF Eric) Date: Tue, 7 Jun 2005 18:44:56 +0200 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: <200506071844.56656.debief@telemsa.com> Hi, We are "pushing" RxTx /Java here in a half-duplex link. The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC and application handling) about 25?s/byte. The figures are the barely the same on two environments. Environment 1 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Linux 2.6.3, Mdk 10.0. RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : bytes are lost on the wire. I need to investigate this mystery.... Java : 1.4.2-rc1 Blackdown Environment 2 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Windows 2000 Pro RxTx : 2.0.7. Java : 1.4.2_08 SUN I Hope this help, Eric. _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 7 11:05:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:05:45 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, DEBIEF Eric wrote: > Hi, > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. How many write() calls is this? > > Environment 1 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Linux 2.6.3, Mdk 10.0. > RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : > bytes are lost on the wire. I need to investigate this mystery.... > Java : 1.4.2-rc1 Blackdown > > Environment 2 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Windows 2000 Pro > RxTx : 2.0.7. > Java : 1.4.2_08 SUN > In my event/read/write test I found windows was ~20% faster than linux for some reason (strange part is Windows was in VMWare on the same Linux machine). It was about the same rxtx version. There are many problems with rxtx 1.4 with respect to commapi on windows but its code paths are more simple. What some people want from rxtx is perhaps better served by hacking up the very first release as they just want to read and write which is what rxtx was before Sun released commapi. It sounds like perhaps you are pushing out larger writes which will greatly improve results. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 11:16:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:16:49 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118161289.42a5c989cf6a2@imp4-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: On Tue, 7 Jun 2005 carobizar at free.fr wrote: > > Hello ! > > I am a french student and I have to create an application able to read and write > on serial and parallel port and to run on Windows and Linux. > For the moment my program run on Windows thanks the Java Communication API > (version for Microsoft Windows and Solaris/x86). > But it doesn't work on Linux. > > Does a recent version of an installation documentation exist ? > I didn't find one on the RXTX site (nothing for the windows installation and the > linux installation deals with a "jcl.jar" that I don't know...). > > So, I have some questions : > > 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 > version or Linux&w32 version ?) What are the differences between them ? Which > of them are the most stable ? > Use rxtx 2.0 with commapi for sparc solaris from Sun. If you want your current package javax.comm. > 2) Where have I to put the .so and .dll files ? On Linux just use the source, the configure script will do all of that for you. tar -xzvf rxtx-2.0-version mkdir rxtx-2.0-version/build cd rxtx-2.0-version/build ../configure && make install It will do everything for you. With Windows, you need to create the javax.comm.properties and install the DLL on your path. But you can just use Sun's package too. They are intended to be interchangable. > > 3) What have I to write on the file javax.comm.properties ? Driver=gnu.io.RXTXCommDriver More documentation in INSTALL that comes with the source. Sun's documentation should work too. configure does this for you on Linux. > > 4) Have I to delete the file win32comm.dll included in the Java Comm API ? > No > 5) Have I to keep both comm.jar and RXTXcomm.jar ? > Yes. RXTX 2.1 replaces comm.jar but the package is different (gnu.io) to avoid contaminating Sun's namespace. With rxtx 2.0 you need Sun's comm.jar - they work together. > > Best regards, > Caroline. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Tue Jun 7 12:07:34 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 14:07:34 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 Message-ID: <20050607180632.1543A29D5C8@mail.electronpusher.org> Hello, I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our product includes a built in USB to Serial adapter so that when it is connected to your PC over USB, it appears as a serial port. We had problems with Sun's comm library because it did not detect serial ports coming and going properly. I did run into a few issues with RxTx though. I am building under Windows (we support XP and 2000) under cygwin. I used a simple make file for the c code that works under cygwin and ant to build the java stuff. Attached is a diff file. The patches hit the following issues: ParallelImp.c - I am not using config so there is no config.h for me. Also, gcc didn't like a local file (win32termios.h) getting included with <> . RXTXPort.java - You can get an exception during the writeByte, writeArray, nativeDrain, readByte, read, readArray, readTerminatedArray, and nativeAvailable calls. Without this patch the IOLocked count gets stuck incremented. termios.c - If you try to open a port through CreateFile and get ERROR_ACCESS_DENIED it means someone else is using the port. We need to make sure to use serial_close instead of just close. I found that some devices finish their I/O synchronously. The code was treating this as an error. I also added some checking on the ClearError calls. I found a compile error when debugging is turned on (see the usleep change). SerialImp.c - Again, I don't have a config.h and again we must use quotes and not <> to include win32termios.h . I also commented out a report call since it seems to happen constantly on my system. Feel free to use these in any way that you want or just to ignore them. Thanks! -Dave Acker dacker at nomadio.net Software Engineer Nomadio, Inc. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diffs.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/5671d159/diffs-0006.txt From jon.nall at gmail.com Tue Jun 7 12:28:16 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 13:28:16 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, DEBIEF Eric wrote: > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. Hi. This is helpful, thanks. I can think of 2 reasons I'm not collecting the data as fast as I think I should be: 1) the device to PC connection is not at 100% utilization 2) my SerialPortEventListener processing has too much overhead Are there other explanations I might be missing as to why it takes so long to transfer the data? Thanks. nall. From taj at www.linux.org.uk Tue Jun 7 13:21:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:21:46 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > On 6/7/05, DEBIEF Eric wrote: > > We are "pushing" RxTx /Java here in a half-duplex link. > > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > > and application handling) about 25?s/byte. > > The figures are the barely the same on two environments. > > Hi. > This is helpful, thanks. I can think of 2 reasons I'm not collecting > the data as fast as I think I should be: > 1) the device to PC connection is not at 100% utilization > 2) my SerialPortEventListener processing has too much overhead > > Are there other explanations I might be missing as to why it takes so > long to transfer the data? > Polling the port would probably make more sense. You can set the threshold/timeouts to avoid racing and not deal with the event notification. As mentioned earlier I think the event latency is ~10ms. Keep the event listener around, rxtx 2.* does not close well without it. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 13:27:27 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 14:27:27 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, Trent Jarvi wrote: > Polling the port would probably make more sense. You can set the > threshold/timeouts to avoid racing and not deal with the event > notification. As mentioned earlier I think the event latency is ~10ms. Trent, Thanks for the response. Just to make sure I understand what you're talking about, when you say event latency, do you mean the time it takes from when the byte hits the PC's comm port to when rxtx presents it to user code? So if the link is 100% utilized, will my user code see "hiccups" or a steady stream of data? Thanks for helping a serial port newbie. nall. From dacker at nomadio.net Tue Jun 7 13:32:20 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 15:32:20 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <20050607193118.5499329CAA0@mail.electronpusher.org> Some folks asked about the make file and ant steps. I have JAVA_HOME set as follows: $ echo $JAVA_HOME C:\Program Files\Java\jdk1.5.0_01 I have all the code in rxtx/src put into gnu/io . The make file here doesn't have optimizations turned on. We have not tested with it yet. --------------Begin Makefile------------------ CPPFLAGS="-I$(JAVA_HOME)/include" "-I$(JAVA_HOME)/include/win32" SOBJECTS=SerialImp.o fuserImp.o termios.o fixup.o init.o POBJECTS=ParallelImp.o termios.o init.o DLLS=rxtxParallel.dll rxtxSerial.dll all: $(CLASSES) $(DLLS) rxtxSerial.dll: $(SOBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(SOBJECTS) rxtxParallel.dll: $(POBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(POBJECTS) clean: rm -fv $(SOBJECTS) $(POBJECTS) $(DLLS) %.o: %.c gcc -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< %.o: %.cpp g++ -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< --------------End Makefile------------------ Here is the ant target I use to build the rxtx libs. Our build puts the class files in a bin dir. We copy the dlls to a deploy dir and to the build dir. Eclipse seems to like the dlls in the build dir. The deploy dir is used when we build our full package. --------------Begin Ant Section------------------ --------------End Ant Section------------------ > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > David S. Acker > Sent: Tuesday, June 07, 2005 2:08 PM > To: 'Java RXTX discussion' > Subject: [Rxtx] Patches to 2.1-7pre17 > > Hello, > I am using RxTx with the Nomadio Sensor, > http://www.nomadio.net/ . Our product includes a built in > USB to Serial adapter so that when it is connected to your PC > over USB, it appears as a serial port. We had problems with > Sun's comm library because it did not detect serial ports > coming and going properly. > > I did run into a few issues with RxTx though. I am building > under Windows (we support XP and 2000) under cygwin. I used > a simple make file for the c code that works under cygwin and > ant to build the java stuff. Attached is a diff file. The > patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h > for me. Also, gcc didn't like a local file (win32termios.h) > getting included with <> . > > RXTXPort.java - You can get an exception during the > writeByte, writeArray, nativeDrain, readByte, read, > readArray, readTerminatedArray, and nativeAvailable calls. > Without this patch the IOLocked count gets stuck incremented. > > termios.c - If you try to open a port through CreateFile and > get ERROR_ACCESS_DENIED it means someone else is using the > port. We need to make sure to use serial_close instead of > just close. I found that some devices finish their I/O > synchronously. The code was treating this as an error. I > also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we > must use quotes and not <> to include win32termios.h . I > also commented out a report call since it seems to happen > constantly on my system. > > Feel free to use these in any way that you want or just to > ignore them. > Thanks! > > -Dave Acker > dacker at nomadio.net > Software Engineer > Nomadio, Inc. > From taj at www.linux.org.uk Tue Jun 7 13:37:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:37:45 +0100 (BST) Subject: [Rxtx] Re: Stack Smashing Attack In-Reply-To: <200506072012.48860.ferdinand.tatzig@web.de> References: <200506072012.48860.ferdinand.tatzig@web.de> Message-ID: On Tue, 7 Jun 2005, Ferdinand Tatzig wrote: > Dear Trent > > I am using RXTX for serial port communication between a PC and a payment > transaction terminal. > When I run my application under Windows 2000, an i386-Linux or an i386-FreeBSD > it works as I expect it to do. However, when I start it to run on AMD64 > machine with a 64-bit Gentoo Linux, the VM terminates with the following > error: > > Port found: /dev/ttyS0 > java: stack smashing attack in function configure_port() > > I am using a 64-bit Blackdown-1.4.2-01 VM. > > I have searched the internet but have found no information about this error. > > This is the code of the method which initializes the serial port: > > /** > * initializes a serial port for communication with a terminal; only > * accessible within this class > * > * @param communication > * @param serialPortToBeInitialized > * @param tillInterfaceEventListener > */ > private TillInterfaceSerialPort(Communication communication, > String serialPortToBeInitialized, > TillInterfaceEventListener tillInterfaceEventListener) > throws IOException, PortInUseException, > TillInterfaceSerialPortNotFoundException, > TooManyListenersException, UnsupportedCommOperationException { > serialPortName = "not initialized yet"; > CommPortIdentifier portId = null; > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > boolean portFound = false; > String temporarySerialPortName = "not initialized yet"; > > // look for a serial port > while (portList.hasMoreElements() && !portFound) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > temporarySerialPortName = portId.getName(); > if (temporarySerialPortName.equals(serialPortToBeInitialized)) { > System.out.print("Port found: "); > System.out.println(temporarySerialPortName); > serialPortName = temporarySerialPortName; > portFound = true; > } > } > } > if (portFound) { > > // initialize the found port - this command causes the VM to terminate > serialPort = (SerialPort) portId > .open( > TillInterfaceConstants.APPLICATION_NAME, > TillInterfaceConstants > .TIMEOUT_IN_MILLISECONDS_FOR_OPENING_OF_COMMUNICATION_PORT); > > // add an event listener which listens > // on the serial port and notifies the > // serial port object when input bytes > // have been received at the port > serialPort.addEventListener(tillInterfaceEventListener); > serialPort.notifyOnDataAvailable(true); > > // initialize the physical layer > // parameters of the serial port > serialPort.setSerialPortParams(TillInterfaceConstants.BAUD_RATE, > SerialPort.DATABITS_8, SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > // set the inter-character > // timeout (T2) > serialPort > .enableReceiveTimeout(TillInterfaceConstants.INTERCHARACTER_TIMEOUT_IN_MILLISECONDS); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > } else > throw new TillInterfaceSerialPortNotFoundException(); > } > > Any hint to solve this problem would be kindly appreciated. > The only thing that comes to mind here after looking at the offending function is rxtx used to include asm/termios.h but now we moved to termios.h and had glibc fix their headers. The asm/termios.h caused problems as its termios was smaller than the actual termios. This should be fixed in current rxtx versions but you can just glance at SerialImp.c and make sure it does not include asm/termios.h. I've cc'd the rxtx mail list because there was one other mention of stack problems recently. I have used rxtx on opteron systems with success. I have a bug I'm trying hard to reproduce on suse 64 bit (circa linux 2.4.19) systems though. So far I have not been able to reproduce the bug. That said, with gentoo... I like gentoo but I seriously doubt they do any QA with their kernel and Java. I've seen problems before. If you use gentoo and have Java problems, at least stick to Linus (that is an s there) kernels while using Java. I'm not an expert on gentoo but I've seen patches go into experimental kernels that turn out to break java and are reverted before going to Linus just before I see problems with gentoo on this list. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:16:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:16:14 +0100 (BST) Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: On Tue, 7 Jun 2005, David S. Acker wrote: > Hello, > I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our > product includes a built in USB to Serial adapter so that when it is > connected to your PC over USB, it appears as a serial port. We had problems > with Sun's comm library because it did not detect serial ports coming and > going properly. > > I did run into a few issues with RxTx though. I am building under Windows > (we support XP and 2000) under cygwin. I used a simple make file for the c > code that works under cygwin and ant to build the java stuff. Attached is a > diff file. The patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h for me. Also, > gcc didn't like a local file (win32termios.h) getting included with <> . > > RXTXPort.java - You can get an exception during the writeByte, writeArray, > nativeDrain, readByte, read, readArray, readTerminatedArray, and > nativeAvailable calls. Without this patch the IOLocked count gets stuck > incremented. > > termios.c - If you try to open a port through CreateFile and get > ERROR_ACCESS_DENIED it means someone else is using the port. We need to > make sure to use serial_close instead of just close. I found that some > devices finish their I/O synchronously. The code was treating this as an > error. I also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we must use quotes > and not <> to include win32termios.h . I also commented out a report call > since it seems to happen constantly on my system. > > Feel free to use these in any way that you want or just to ignore them. > Thanks! > Hi Dave These patches look great as is. Thanks. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:33:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:33:16 +0100 (BST) Subject: [Rxtx] Patch to IOLocked (fwd) Message-ID: This appears to be another solution to the locking. Chris, the other option just moves the locking into the finally clause which I think would be a little cleaner though I'm posting this patch to so people can comment. -- Trent Jarvi tjarvi at qbang.org ---------- Forwarded message ---------- Date: Wed, 1 Jun 2005 13:01:32 +0100 From: Christopher Dawes To: taj at www.linux.org.uk Subject: Patch to IOLocked Do you want me to check it out of CVS and then submit changes? Christopher -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXPort.java.diff Type: application/octet-stream Size: 6965 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/c442f9fc/RXTXPort.java-0006.obj From Christopher.Dawes at retail-logic.com Wed Jun 8 00:57:24 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 8 Jun 2005 07:57:24 +0100 Subject: [Rxtx] Patch to IOLocked (fwd) [Virus Checked] In-Reply-To: Message-ID: Agreed, much better Java :-) Thanks Christopher ------------------------------------------- Consultant Engineer Retail Logic Limited Fleet GU51 3TZ Tel: +44 (0)1252 644377 Mob: +44 (0)7899 842759 Fax: +44 (0)1252 776708 rxtx-bounces at mail.electronpusher.org wrote on 07/06/2005 21:33:16: > > This appears to be another solution to the locking. Chris, the other > option just moves the locking into the finally clause which I think would > be a little cleaner though I'm posting this patch to so people can > comment. > > -- > Trent Jarvi > tjarvi at qbang.org > > ---------- Forwarded message ---------- > Date: Wed, 1 Jun 2005 13:01:32 +0100 > From: Christopher Dawes > To: taj at www.linux.org.uk > Subject: Patch to IOLocked > > Do you want me to check it out of CVS and then submit changes? > > Christopher[attachment "RXTXPort.java.diff" deleted by Chris > Dawes/Retaillogic/NISABA] _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx From zempftman at gmail.com Wed Jun 8 07:57:25 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 09:57:25 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Maxwell Zempftman Date: May 27, 2005 5:01 PM Subject: Re: [Rxtx] Kaffe & rxtx & armv5b To: rxtx at mail.linuxgrrls.org Here are the results from working this week: The "NullPointerExceptions" are generated by the software when I choose a bad device file. I discovered that this occurs on the i686-RedHat box as well. This exception seems to be generated only by this particular application, and not by the example programs in contrib. So, for example: java MyApp /dev/null <-- generates NullPointerException java MyApp fake <-- generates NullPointerException java MyApp /dev/ttyS0 <-- does not generate NullPointerException Using the program CommCheck (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it appears as though /dev/ttyS0 is the only valid serial device file on the XScale device, so the errors I was getting are not really be bugs. Although /dev/ttyS0 did not generate NullPointerExceptions, I did encounter this error: --start java MyApp /dev/ttyS0 (going mostly from memory, not exact) PortList.hasMoreElements: true Listening on: /dev/ttyS0 Client connected. >From net: echo kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 vmExcept_setJNIFrame Assert: on 'fp != 0' failed. --end I took a look at exception.h, and it seems as though the problematic code does not exist in newer versions of Kaffe (I have been using CVS-2004-11). Next week I will try to use a newer version, although so far everything but CVS-2004-11 has failed. Also, I the device files I need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with something like this? Thanks, Max. > On 5/21/05, Trent Jarvi wrote: > > I'm not sure what is wrong in the first part. It sounds like your > > application may be swallowing an exception while trying to enumerate the > > port or open it. The usual mistake made it not having permissions to > > either open the port or create the lockfile. There should be examples in > > the contrib directory you can try that enumerate and open ports. Maybe > > that will give you some hints. > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > Sun's code limiting you there though you do need to compile and install > > rxtx for the XScale with Sun's Commapi. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > From taj at www.linux.org.uk Wed Jun 8 08:22:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 15:22:44 +0100 (BST) Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > ---------- Forwarded message ---------- > From: Maxwell Zempftman > Date: May 27, 2005 5:01 PM > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > To: rxtx at mail.linuxgrrls.org > > > Here are the results from working this week: > > The "NullPointerExceptions" are generated by the software when I > choose a bad device file. I discovered that this occurs on the > i686-RedHat box as well. This exception seems to be generated only by > this particular application, and not by the example programs in > contrib. So, for example: > > java MyApp /dev/null <-- generates NullPointerException > java MyApp fake <-- generates NullPointerException > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > Using the program CommCheck > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > appears as though /dev/ttyS0 is the only valid serial device file on > the XScale device, so the errors I was getting are not really be bugs. > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > encounter this error: > > --start > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > PortList.hasMoreElements: true > Listening on: /dev/ttyS0 > Client connected. > >From net: echo > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > --end > > I took a look at exception.h, and it seems as though the problematic > code does not exist in newer versions of Kaffe (I have been using > CVS-2004-11). Next week I will try to use a newer version, although so > far everything but CVS-2004-11 has failed. Also, I the device files I > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > something like this? > In RXTXCommDriver, just look for the following code and add /dev/ttyM to the list. Moxa? if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } So: if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyM", // for Moxa ports "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } Linux just has way too many port types to try enumerating them all. There is potential we can add them back in with udev now. > Thanks, > Max. > > > On 5/21/05, Trent Jarvi wrote: > > > I'm not sure what is wrong in the first part. It sounds like your > > > application may be swallowing an exception while trying to enumerate the > > > port or open it. The usual mistake made it not having permissions to > > > either open the port or create the lockfile. There should be examples in > > > the contrib directory you can try that enumerate and open ports. Maybe > > > that will give you some hints. > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > Sun's code limiting you there though you do need to compile and install > > > rxtx for the XScale with Sun's Commapi. > > > > > > -- > > > Trent Jarvi > > > tjarvi at qbang.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Wed Jun 8 12:16:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 08 Jun 2005 13:16:03 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A60B8D.8080500@cs.umn.edu> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> Message-ID: <42A735E3.8040706@atcorp.com> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual serial comport. This isn't so much of a problem, what is, however, is that the comport does not appear to be able to be set to any arbitrary speed, only those from the data_rate enum. I've not found much on using different speeds, has anyone else encountered anything similar? I greatly appreciate any and all comments and suggestions. Thanks in advance, ~ Shawn Lavelle From zempftman at gmail.com Wed Jun 8 12:50:58 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 14:50:58 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: Thanks Trent! That will solve one of the problems. I don't know when my next chance to work on it will be, but I still need to figure out the error I got when I tried opening '/dev/ttyS0' on the Moxa device regarding a failed assertion, seemed to be a Kaffe issue. Thanks for you help, hope to have results soon, Max Englander. On 6/8/05, Trent Jarvi wrote: > On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > > > ---------- Forwarded message ---------- > > From: Maxwell Zempftman > > Date: May 27, 2005 5:01 PM > > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > > To: rxtx at mail.linuxgrrls.org > > > > > > Here are the results from working this week: > > > > The "NullPointerExceptions" are generated by the software when I > > choose a bad device file. I discovered that this occurs on the > > i686-RedHat box as well. This exception seems to be generated only by > > this particular application, and not by the example programs in > > contrib. So, for example: > > > > java MyApp /dev/null <-- generates NullPointerException > > java MyApp fake <-- generates NullPointerException > > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > > > Using the program CommCheck > > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > > appears as though /dev/ttyS0 is the only valid serial device file on > > the XScale device, so the errors I was getting are not really be bugs. > > > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > > encounter this error: > > > > --start > > > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > > > PortList.hasMoreElements: true > > Listening on: /dev/ttyS0 > > Client connected. > > >From net: echo > > > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > > > --end > > > > I took a look at exception.h, and it seems as though the problematic > > code does not exist in newer versions of Kaffe (I have been using > > CVS-2004-11). Next week I will try to use a newer version, although so > > far everything but CVS-2004-11 has failed. Also, I the device files I > > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > > something like this? > > > > > In RXTXCommDriver, just look for the following code and add /dev/ttyM to > the list. Moxa? > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > So: > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyM", // for Moxa ports > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > Linux just has way too many port types to try enumerating them all. There > is potential we can add them back in with udev now. > > > > > Thanks, > > Max. > > > > > On 5/21/05, Trent Jarvi wrote: > > > > I'm not sure what is wrong in the first part. It sounds like your > > > > application may be swallowing an exception while trying to enumerate the > > > > port or open it. The usual mistake made it not having permissions to > > > > either open the port or create the lockfile. There should be examples in > > > > the contrib directory you can try that enumerate and open ports. Maybe > > > > that will give you some hints. > > > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > > Sun's code limiting you there though you do need to compile and install > > > > rxtx for the XScale with Sun's Commapi. > > > > > > > > -- > > > > Trent Jarvi > > > > tjarvi at qbang.org > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- > Trent Jarvi > tjarvi at qbang.org > From taj at www.linux.org.uk Wed Jun 8 12:53:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 19:53:10 +0100 (BST) Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A735E3.8040706@atcorp.com> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: On Wed, 8 Jun 2005, Shawn Lavelle wrote: > Hello, > I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate > with a virtual serial comport. This isn't so much of a problem, what > is, however, is that the comport does not appear to be able to be set to > any arbitrary speed, only those from the data_rate enum. I've not found > much on using different speeds, has anyone else encountered anything > similar? I greatly appreciate any and all comments and suggestions. > This problem is a bit more tricky than it should be. POSIX systems just have a few specified baud rates. Solaris is one of these systems. CommAPI baud rates probably came from someone looking at Solaris. RXTX tries to be POSIX like. W32 is treated as a POSIX like system via a termios.c file in rxtx. Serial ports have baudbase and divisor. So you can set these to come close to the baudrate you want. Some funky equipment like automobile test equipment use baud rates that are not really possible with PC hardware. But if you get as close as possible by changing baud base and divisor, it works. Windows can actually do this for you. I don't know exactly what their code does but if you pass a baudrate to windows, it will guestimate a baudbase and divisor. So you just pass it 10200 baud and it does its job. This is not of very much use the way rxtx does things though. Linux has the standard POSIX like baud rates but if you set the baud rate to B38400, you can set your own baud base and divisor. This is not POSIX that I know of. W32 has more capability than POSIX like systems too. So I did some work to have windows work like Linux via termios.c But the code is not quit right. SerialImp.c and termios.c need some work so all the various buadrates work on Linux and W32. Most other systems will not work beyond what CommAPI already specifies without writting kernel drivers. This is on my todo list but if someone gets to it first, all the better. -- Trent Jarvi tjarvi at qbang.org From carobizar at free.fr Thu Jun 9 06:39:10 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Thu, 9 Jun 2005 14:39:10 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: <1118320750.42a8386e6d3ce@imp5-q.free.fr> Hi ! Thank you for all your advices. I managed to use rxtx on Windows but I have still some difficulties on Linux. I have yet follow your instructions and the configure file has created : - librxtxSerial.so and librxtxParallel.so in the directory /usr/java/j2sdk1.4.2_08/jre/lib/i386 - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the directory /usr/java/j2sdk1.4.2_08/jre/lib - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext But when I run my program, Some exceptions occur : Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver So, 1) What have I forgotten ? 2) Is it possible to make my application run on Linux without the jdk (only the jre) ? Best regards, Caroline. From taj at www.linux.org.uk Thu Jun 9 07:28:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 9 Jun 2005 14:28:05 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118320750.42a8386e6d3ce@imp5-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: On Thu, 9 Jun 2005 carobizar at free.fr wrote: > Hi ! > Thank you for all your advices. > I managed to use rxtx on Windows but I have still some difficulties on Linux. > I have yet follow your instructions and the configure file has created : > - librxtxSerial.so and librxtxParallel.so in the directory > /usr/java/j2sdk1.4.2_08/jre/lib/i386 > - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the > directory /usr/java/j2sdk1.4.2_08/jre/lib > - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext > > But when I run my program, Some exceptions occur : > Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while > loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > com.sun.comm.SolarisDriver > > So, > 1) What have I forgotten ? > The native (.so) libraries are not installed in a directory the JRE is looking for native libraries in. You may look around and see where the .so libraries are in the JRE. I don't know that the jre/lib/i386 directory is specified as a required directory for JREs. I noticed some do not use it. You may try printing the java.libarary.path to see your options. It is also possible to alter the java.library.path. > 2) Is it possible to make my application run on Linux without the jdk (only the > jre) ? Yes. Though installation from source with the JDK is less error prone. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0006.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 7 15:03:09 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 07 Jun 2005 16:03:09 -0500 Subject: [Rxtx] Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <42A60B8D.8080500@cs.umn.edu> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual comport. This isn't so much of a problem, what is, however, is that the comport is only ever set to 9600 baud. I've not found this as a documented bug, has anyone else encountered anything similar? I'll try and provide more detail tomorrow, but if anyone has any suggestions or encountered this before, I'd like to hear about it. Thanks in advance, ~ Shawn Lavelle From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0006.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0006.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0006.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Mon Jun 20 01:04:40 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 20 Jun 2005 08:04:40 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: <42B66A88.4060806@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050620/9be208a1/attachment-0006.html From fbalzarro at libero.it Mon Jun 20 02:33:52 2005 From: fbalzarro at libero.it (Fabio Balzarro) Date: Mon, 20 Jun 2005 10:33:52 +0200 Subject: [Rxtx] RXTXPort:close detected bad file descriptor Message-ID: I'm using RXTX libraries on IPAQ 4150 PDA with Windows CE 4.20 and Jeode. When I close a serial port with sp.close() (where sp is a SerialPort) sometimes an error occour 1119256168085: RXTXPort:close detected bad file descriptor What can I do? Thanks Fabio ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From slavelle at atcorp.com Mon Jun 20 08:08:19 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 20 Jun 2005 09:08:19 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: <42B6CDD3.4040409@atcorp.com> It turns out that I did have a driver-not-used issue which has now been resolved and I can use RxTx on it (had to add ttyUSB as a valid port), but only at standard baud rates. Does USB have the same restrictions on port speed as regular RS232? ~ Shawn Trent Jarvi wrote: > Just a note here. > > I have requested a FTDI usb device and they offered to send one for the > purpose of trying to get rxtx working. I have no idea how long that takes > though. > > > On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > > >>I'm afraid we're just using the latest version from the FTDI website. I've >>not yet played with linux properly with this and unfortunately I run gentoo >>and haven't yet successfully compiled in the ftdi driver. I'll let you know >>if I get any success. >> >>Appologies >> >>Christopher >> >>-----Original Message----- >>From: rxtx-bounces at mail.electronpusher.org >>[mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle >>Sent: 15 June 2005 00:00 >>To: Java RXTX discussion >>Subject: Re: [Rxtx] Virtual Com Ports >> >>Hmm, the latter sounds like a lot of work. It does find the virtual comport >>in windows, i must have just missed it earlier (sign of a long day). On the >>linux side, I suspect that something is not correct with the driver >>installation becuase it does not give me a tty for it :( >> >>Christopher, May I ask what driver you are using for your FTDI chip? >>Did you ever encounter problems with not getting a tty assigned for it? >> >> >> Thanks for all your help! >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>They will have to show up as a tty device in Linux. Probably ttyUSB? >>>That will need an entry in RXTXCommDriver.java. If they dont show up >>>as a tty device, rxtx cant treat it like a serial port. It just wont >> >>work. >> >>>With COM3, rxtx will try to open the port and perform a timed out read. >>>Usually if a port is not there, the read blows up or the open blows up. >>>Timing out is fine. COM3 used to share interrupts with COM1. I know >>>you can reassign ports in XP. RXTX scans up through COM255. You may >>>try moving it. >>> >>> >>>The code in question is the following in RXTXCommDriver.java >>> >>> >>> if(osName.equals("Linux")) >>> { >>> String[] Temp = { >>> "ttyS", // linux Serial Ports >>> "ttySA", // for the IPAQs >>> "ttyUSB" // for USB frobs >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>> else if(osName.toLowerCase().indexOf("windows") != -1 ) >>> { >>> String[] Temp = { >>> "COM" // win32 serial ports >>> //"//./COM" // win32 serial ports >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>>If COM3 can be read, it should be found. the ttyUSB should work if >>>thats in the version of RXTXCommDriver.java you have. >>> >>>If this is still a problem, it may be that the driver is erroring on >>>what may be considered normal comm port operations such as setting the >>>speed, timeout, threshold, .. One would have to start looking at each >>>function called in the native open() and read(). >>> >>> >>> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>>seems to find the device using rxtx. Looking at the hardware >>>>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>>>linux. I can't seem to get it to show up as a tty(s#) in linux which >>>>is probably just due to my lack of significant linux knowledge. >>>> >>>> ~ Shawn >>>> >>>>Trent Jarvi wrote: >>>> >>>> >>>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>Has anyone here noticed that virtual comports do not get enumerated >>>>>>via CommPortIdentifier.getPortIdentifiers()?? >>>>>> >>>>>>The device I'm trying to talk to uses an fdti usb to serial >>>>>>convertor with a driver that has it show up as a virtual comport. I >>>>>>can enter this port manually and it will be usable but I cannot get >>>>>>it show up automatically (as in the simple serial demo). Any thoughts >> >>on this? >> >>>>> >>>>>Hi Shawn, >>>>> >>>>>What OS is this and what is the name of the virtual port you are >>>>>trying to open? I suspect the name just needs to be added to >> >>RXTXCommDriver.java. >> >>>>_______________________________________________ >>>>Rxtx mailing list >>>>Rxtx at mail.electronpusher.org >>>>http://www.electronpusher.org/mailman/listinfo/rxtx >>>> >>> >>> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From lyon at docjava.com Mon Jun 20 15:06:08 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 20 Jun 2005 17:06:08 -0400 Subject: [Rxtx] testing Message-ID: Hi All, I am testing my new multi-platform Java Webstart RXTX application (Trent: I could not have done it without you!). So far, I think it will work under Linux (x86), Windows XP, Windows 2000 and MacOS X. The application is available as a Java webstart application at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Edit:Preferences: SerialPort Setup... should bring up a dialog box that enables dialing via the modem. Generally, it does not find internal modems (except on the mac). Why, I don't know. Thanks in advance for trying this new app. All feedback on it is welcome. - Doug Lyon From jasmine at electronpusher.org Tue Jun 21 04:15:53 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Tue, 21 Jun 2005 11:15:53 +0100 Subject: [Rxtx] testing In-Reply-To: References: Message-ID: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > Hi All, > I am testing my new multi-platform Java Webstart RXTX application > (Trent: I could not have done it without you!). > > So far, I think it will work under Linux (x86), Windows XP, > Windows 2000 and MacOS X. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. -J. From taj at www.linux.org.uk Tue Jun 21 05:50:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 12:50:23 +0100 (BST) Subject: [Rxtx] testing In-Reply-To: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> References: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> Message-ID: On Tue, 21 Jun 2005, Jasmine Strong wrote: > > On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > > > Hi All, > > I am testing my new multi-platform Java Webstart RXTX application > > (Trent: I could not have done it without you!). > > > > So far, I think it will work under Linux (x86), Windows XP, > > Windows 2000 and MacOS X. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > on my Mac. > passing -source 1.3 -target 1.3 to javac will compile classes without this problem. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 10:19:25 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 11:19:25 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. Sincerely, Jeremyah Payne From ricardo.trindade at emation.pt Tue Jun 21 13:25:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 20:25:00 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B8698C.2060509@emation.pt> Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > From taj at www.linux.org.uk Tue Jun 21 13:39:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:39:43 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <42B8698C.2060509@emation.pt> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> <42B8698C.2060509@emation.pt> Message-ID: It looks like he has an rs422 device/converter. This is not the problematic 'trying to do protocol X with a serial port' situation unless I'm missing something. I'll follow up with the other email I started. On Tue, 21 Jun 2005, Ricardo Trindade wrote: > Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. > > Payne, Jeremyah L (N-CIM) wrote: > > >Good morning, my name is Jeremyah and I am working on a java project to > >interface with some devices. In short, I have a laptop with a PCMIA > >converter that does RS422 running windows 2000. I also will be > >installing some PCI cards into some Linux boxes that will have probably > >4-8 RS422 ports on them. After doing some reading in order to talk > >with these items using my existing java code I will need an additional > >driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > >trying to get a map sort of where I need to make changes. As I see it, > >I would need to subclass SerialPort to my RS422 interface. That would > >link with a DLL or SO implementation that talks with the hardware. I > >also need to change the listing of working ports in the lookup section > >for serial. Does this seem like I am on the right track? Appreciate > >the support. > > > > > >Sincerely, > >Jeremyah Payne > >_______________________________________________ > >Rxtx mailing list > >Rxtx at mail.electronpusher.org > >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 21 13:40:25 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:40:25 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: On Tue, 21 Jun 2005, Payne, Jeremyah L (N-CIM) wrote: > Good morning, my name is Jeremyah and I am working on a java project to > interface with some devices. In short, I have a laptop with a PCMIA > converter that does RS422 running windows 2000. I also will be > installing some PCI cards into some Linux boxes that will have probably > 4-8 RS422 ports on them. After doing some reading in order to talk with > these items using my existing java code I will need an additional > driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > trying to get a map sort of where I need to make changes. As I see it, I > would need to subclass SerialPort to my RS422 interface. That would link > with a DLL or SO implementation that talks with the hardware. I also > need to change the listing of working ports in the lookup section for > serial. Does this seem like I am on the right track? Appreciate the > support. > Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 13:40:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 14:40:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618954@emss02m08.us.lmco.com> I'd like to except I am dealing with NASA. I am basically building a system to monitor 100+ Units that communicate over RS422. They have some converters in place but want to get rid of them. I'll check through the archives. I had started looking yesterday as was leaving work. -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Ricardo Trindade Sent: Tuesday, June 21, 2005 2:25 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From slavelle at atcorp.com Tue Jun 21 14:58:06 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 21 Jun 2005 15:58:06 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: <42B87F5E.4000403@atcorp.com> > Linux has the standard POSIX like baud rates but if you set the baud rate > to B38400, you can set your own baud base and divisor. This is not POSIX > that I know of. W32 has more capability than POSIX like systems too. So > I did some work to have windows work like Linux via termios.c > > But the code is not quit right. SerialImp.c and termios.c need some > work so all the various buadrates work on Linux and W32. Most other > systems will not work beyond what CommAPI already specifies without > writting kernel drivers. > > This is on my todo list but if someone gets to it first, all the better. Hmm, I guess I didn't read this close enough before. Just to be clear, the pieces to setBaudBase and setDivisor are not yet implemented, correct? Thanks, Shawn From sean_montgomery at baseview.com Tue Jun 21 15:14:08 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 21 Jun 2005 17:14:08 -0400 Subject: [Rxtx] OS X installation - file locations Message-ID: <8AB82C7F-0D19-45F9-AE54-A12C59A8495E@baseview.com> Greetings, I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) using the RXTX installation instructions. RXTX worked fine. Basically you've got: - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions - javax.comm.properties in /System/Library/Frameworks/ JavaVM.framework/Home/lib - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ lib/ext My coworker was concerned that the installation required files to be placed in /System/Library... because those directories are "Apple's" and subject to change at Apple's whim, and that it would be safer (less likely to break when a user updates their OS or Java version or what have you) if all the files could be somewhere in /Library... or / Library/Java. My coworker points out that when 3rd party apps like FrontBase and JBoss need to communicate with Java their jars are placed in /Library/Java/Extensions. Granted that RXTX 2.0 is implementing javax.comm and not just a 3rd party extension, might that be the case - that javax.* stuff needs to be in the Java system files? I'm not the Java maven that my coworker is, so I don't know if any of this is gospel or not. Any OS X/Java experts out there willing to comment? We'd like to be able to install RXTX in the safest, most maintenance free way possible, but if there are specific reasons why javax.comm.properties and comm.jar need to be in /System... then so be it. Any information is welcome, Sean From ricardo.trindade at emation.pt Tue Jun 21 15:56:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 22:56:53 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B88D25.7060604@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050621/f6c9f5fe/attachment-0006.html From jeremyah.l.payne at lmco.com Tue Jun 21 15:22:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 16:22:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618955@emss02m08.us.lmco.com> -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Trent Jarvi Sent: Tuesday, June 21, 2005 2:40 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 As of yet we have not decided on the PCI boards to use yet So I am still waiting to se how we will interface to them. But the laptop is ready to use so ill build a test app for that API for now. The overview of class structure is really what I needed. I guess I will use the 2.1 as you suggested. Thanks for the help thus far! BTW, you guys wouldn't happen to keep class diagrams or anything of that nature around would you? If not I will probably end up having to do some anyway for documentation purposes, I could include them. Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From dmarkman at mac.com Tue Jun 21 18:13:28 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 21 Jun 2005 20:13:28 -0400 Subject: [Rxtx] OS X installation - file locations In-Reply-To: References: Message-ID: <044F520C-585C-4B99-82ED-3BA83DB8CE77@mac.com> Apple doesn't recommend to put jars into the /System/Library/Frameworks/JavaVM.framework/Home/lib/ext folder from other hands it's standard java directory to put extentions if you want to support comm api on whole system then I'd recommend to put jars into the /Library/Java/Extensions folder just like you did if you want to support comm api per user put your jars into the ~/ Library/Java/Extensions On Jun 21, 2005, at 5:14 PM, Java RXTX discussion wrote: > Greetings, > > > I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) > using the RXTX installation instructions. RXTX worked fine. > > > Basically you've got: > - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions > - javax.comm.properties in /System/Library/Frameworks/ > JavaVM.framework/Home/lib > - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ > lib/ext > > > My coworker was concerned that the installation required files to be > placed in /System/Library... because those directories are "Apple's" > and subject to change at Apple's whim, and that it would be safer > (less likely to break when a user updates their OS or Java version or > what have you) if all the files could be somewhere in /Library... or / > Library/Java. My coworker points out that when 3rd party apps like > FrontBase and JBoss need to communicate with Java their jars are > placed in /Library/Java/Extensions. Granted that RXTX 2.0 is > implementing javax.comm and not just a 3rd party extension, might > that be the case - that javax.* stuff needs to be in the Java system > files? > > > I'm not the Java maven that my coworker is, so I don't know if any of > this is gospel or not. Any OS X/Java experts out there willing to > comment? We'd like to be able to install RXTX in the safest, most > maintenance free way possible, but if there are specific reasons why > javax.comm.properties and comm.jar need to be in /System... then so > be it. > > > Any information is welcome, > > > Sean > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Dmitry Markman Dmitry Markman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050622/beea65d0/attachment-0006.html From lyon at docjava.com Thu Jun 23 04:39:47 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 23 Jun 2005 06:39:47 -0400 Subject: [Rxtx] web start + RXTX = strange errors? Message-ID: On: Date: Tue, 21 Jun 2005 11:15:53 +0100 From: Jasmine Strong Writes: An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. ----------- I cannot duplicate your error. My version of Java is: java -version java version "1.4.2_05" Is yours the same? Trent: You wrote: passing -source 1.3 -target 1.3 to javac will compile classes without this problem. ----------- OK, I have updated the disto to work with jdk1.3: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Jasmine: Is this working any better? Thanks! - DL From handzisk at tkn.tu-berlin.de Fri Jun 24 02:37:14 2005 From: handzisk at tkn.tu-berlin.de (Vlado Handziski) Date: Fri, 24 Jun 2005 10:37:14 +0200 (CEST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace Message-ID: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Hi all, let me first express my compliments on the great work you have done with the RXTX library. We have been using the library for some time, and we are at a point where we want to make our code public. For legacy reasons, the code that the RXTX library is bundled with, uses the javax.comm namespace. We have been using the ChangePackage script to change the RXTX2.1 package from gnu.io into javax.comm. We need the independent implementation since we want to be able to directly access /dev/ttyUSBx ports in linux and the CommAPI versions are just not as stable. On the download page, there is a comment that this is in violation of sun's license. Can someone shed more light on this. I was not aware that you can protect the names of the java packages. Best regards, Vlado From ricardo.trindade at emation.pt Fri Jun 24 04:01:17 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 11:01:17 +0100 Subject: [Rxtx] parity missed Message-ID: <42BBD9ED.3060004@emation.pt> Hi, I have a "parity missed error". From previous posts I believe this has to do with CMSPAR not being defined. I checked out 2.1 head from CVS. How can I make sure I do a proper build and CMSPAR is defined ? Perhaps it would be good to have a release snapshot that has this, I think the latest snapshot (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. Another question I have, is why must this depend on kernel headers, why can't it be defined in the RXTX source ? thanks Ricardo From jasmine at electronpusher.org Fri Jun 24 04:09:06 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 24 Jun 2005 11:09:06 +0100 Subject: [Rxtx] web start + RXTX = strange errors? In-Reply-To: References: Message-ID: <644aad2bdbba950f0a2fb12d7dcfd8a6@electronpusher.org> On 23 Jun 2005, at 11:39, Dr. Douglas Lyon wrote: > OK, I have updated the disto to work with jdk1.3: > http://show.docjava.com:8086/book/cgij/code/jnlp/ > addbk.JAddressBook.Main.jnlp > > Jasmine: Is this working any better? Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) -J. From taj at www.linux.org.uk Fri Jun 24 10:54:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 17:54:12 +0100 (BST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: On Fri, 24 Jun 2005, Vlado Handziski wrote: > Hi all, > > let me first express my compliments on the great work you have done with > the RXTX library. > > We have been using the library for some time, and we are at a point where > we want to make our code public. For legacy reasons, the code that the > RXTX library is bundled with, uses the javax.comm namespace. We have been > using the ChangePackage script to change the RXTX2.1 package from gnu.io > into javax.comm. We need the independent implementation since we want to > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > versions are just not as stable. > > On the download page, there is a comment that this is in violation of > sun's license. Can someone shed more light on this. I was not aware that > you can protect the names of the java packages. > > Best regards, > Vlado > I can't provide legal advice as I am not a lawyer. (v) may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are contained in the "java", "javax" or "sun" packages or similar as specified by Sun in any class file naming convention; and The license is in the commapi package from Sun. The above is also in all the EULA's you click through to download from Sun if I'm not mistaken. Simply put, the license taints developers that agree to it. For those developers, Sun has control of the javax.comm namespace. It really does not make sense to put rxtx 2.1 in the javax.comm namespace. It will only cause confusion which I think is the point of the clause above. The gnu.io namespace was perhaps a poor choice and just tossed in when reviewing the license to get out of Sun's namespace. There is nothing in the rxtx license limiting your freedom in this fashion though. Many companies are moving to gnu.io and some distribute it with popular applications you would recognize. I'm tempted to ask you not to contaminate rxtx 2.1 with the javax.comm namespace. You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) extensions to existing classes (which I dont think you are using); it is not just javax.comm. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 24 13:24:09 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 20:24:09 +0100 (BST) Subject: [Rxtx] parity missed In-Reply-To: <42BBD9ED.3060004@emation.pt> References: <42BBD9ED.3060004@emation.pt> Message-ID: On Fri, 24 Jun 2005, Ricardo Trindade wrote: > Hi, > > I have a "parity missed error". From previous posts I believe this > has to do with CMSPAR not being defined. > I checked out 2.1 head from CVS. How can I make sure I do a proper > build and CMSPAR is defined ? Perhaps it would be good to have a release > snapshot that has this, I think the latest snapshot > (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. > > Another question I have, is why must this depend on kernel headers, > why can't it be defined in the RXTX source ? > I used to cheat and grab the CMSPAR from the kernel headers because glibc did not have it. Now rxtx uses the glibc headers and we have a patch in glibc I trust that handles this. It would not be right to override glibc and it wasnt right to use the kernel headers (it really did cause problems). You can override glibc for now with the following in the top of SerialImp.c # define CMSPAR 010000000000 You can check if your distro headers have this right bit looking for the above in bits/termios.h. It should look like this: #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif If it is not defined, please file a bug with your distro as rxtx is not the only thing that will be broken on that distro. I was going to release new cvs snapshots last weekend but got tied up. I'll do it this weekend. I also need to get custom baudrate patches into the cvs snapshot. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Fri Jun 24 13:56:50 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 20:56:50 +0100 Subject: [Rxtx] parity missed In-Reply-To: References: <42BBD9ED.3060004@emation.pt> Message-ID: <42BC6582.2070805@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050624/e3b39631/attachment-0006.html From vlado.handziski at gmail.com Sat Jun 25 06:25:52 2005 From: vlado.handziski at gmail.com (Vlado Handziski) Date: Sat, 25 Jun 2005 14:25:52 +0200 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: <697986ec05062505256ebf381f@mail.gmail.com> Thanks for the clarification. Since changing the bundled source is not an option at this moment, we will consider using javax.comm and RXTX2.0. In the next rewrite, we would probably move to gnu.io . Best regards, Vlado Handziski On 6/24/05, Trent Jarvi wrote: > > On Fri, 24 Jun 2005, Vlado Handziski wrote: > > > Hi all, > > > > let me first express my compliments on the great work you have done with > > the RXTX library. > > > > We have been using the library for some time, and we are at a point > where > > we want to make our code public. For legacy reasons, the code that the > > RXTX library is bundled with, uses the javax.comm namespace. We have > been > > using the ChangePackage script to change the RXTX2.1 package from gnu.io > > into javax.comm. We need the independent implementation since we want to > > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > > versions are just not as stable. > > > > On the download page, there is a comment that this is in violation of > > sun's license. Can someone shed more light on this. I was not aware that > > you can protect the names of the java packages. > > > > Best regards, > > Vlado > > > > I can't provide legal advice as I am not a lawyer. > > (v) may not create, or authorize your licensees to create additional > classes, interfaces, or subpackages that are contained in the "java", > "javax" or "sun" packages or similar as specified by Sun in any class file > naming convention; and > > The license is in the commapi package from Sun. The above is also in all > the EULA's you click through to download from Sun if I'm not mistaken. > > Simply put, the license taints developers that agree to it. For those > developers, Sun has control of the javax.comm namespace. > > It really does not make sense to put rxtx 2.1 in the javax.comm namespace. > It will only cause confusion which I think is the point of the clause > above. The gnu.io namespace was perhaps a poor choice and > just tossed in > when reviewing the license to get out of Sun's namespace. > > There is nothing in the rxtx license limiting your freedom in this fashion > though. Many companies are moving to gnu.io and some > distribute it with > popular applications you would recognize. I'm tempted to ask you not > to contaminate rxtx 2.1 with the javax.comm namespace. > > You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm > using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) > extensions to existing classes (which I dont think you are using); it is > not just javax.comm. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050625/1dadc50e/attachment-0006.html From taj at www.linux.org.uk Sun Jun 26 11:34:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 26 Jun 2005 18:34:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. Message-ID: The attached file should fix baud_base and divisor extensions for Linux The patch is against rxtx 2.1 CVS HEAD. To use this patch, you should set the baud rate to 38400. You can then try SerialPort.setBaudBase(int) and SerialPort.setDivisor(int) There are matching int SerialPort.getBaudBase() and int SerialPort.getDivisor(). What baud bases are available depends upon the serial port card and its driver so this is a bit of a blind attempt on my part. I've looked at the w32 API and I dont see anything available yet. The w32 code in RXTX will probably be figuring out the baud rate based on the tried baud base and divisor and just slamming it at the API for now (the API does something with that but I've not found real documentation on what it does). I dont want to try tinkering with the UART directly yet as that would involve poking machine memory directly and could very easily be error prone in bad ways. I don't expect Solaris or any SysV UNIX systems to work at all with this - ever. It is not standard in any way and will throw Exceptions on everything but Linux (w32 will just fail miserably as it is 1/2 implemented). If anyone has looked at custom baud rates before and has some thoughts or just wants to try the attached untested patch, I'd appreciate any feedback. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- ? autom4te.cache ? build ? output cvs server: Diffing . Index: configure =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure,v retrieving revision 1.35.2.59 diff -u -r1.35.2.59 configure --- configure 16 Oct 2004 16:20:34 -0000 1.35.2.59 +++ configure 26 Jun 2005 16:59:28 -0000 @@ -9644,6 +9644,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { #if defined (__GLIBC__) @@ -9782,6 +9784,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { @@ -9825,7 +9829,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -9837,7 +9841,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 26 Jun 2005 16:59:28 -0000 @@ -218,6 +218,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { #if defined (__GLIBC__) @@ -356,6 +358,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { @@ -399,7 +403,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -411,7 +415,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" cvs server: Diffing CNI cvs server: Diffing MACOSX_IDE cvs server: Diffing MACOSX_IDE/CW cvs server: Diffing MACOSX_IDE/ForPackageMaker cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions cvs server: Diffing MACOSX_IDE/ForPackageMaker/Resources cvs server: Diffing MACOSX_IDE/PB cvs server: Diffing WinCE cvs server: Diffing contrib cvs server: Diffing debian cvs server: Diffing src Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 26 Jun 2005 16:59:29 -0000 @@ -2079,15 +2079,17 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int BaudBase The clock frequency divided by 16. Default * BaudBase is 115200. * @return boolean true on success - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:setBaudBase()"); @@ -2097,10 +2099,11 @@ /** * Extension to CommAPI * @return int BaudBase - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getBaudBase() throws UnsupportedCommOperationException + public int getBaudBase() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getBaudBase()"); @@ -2108,13 +2111,14 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, IOException { if ( debug ) z.reportln( "RXTXPort:setDivisor()"); @@ -2124,10 +2128,11 @@ /** * Extension to CommAPI * @returns int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getDivisor() throws UnsupportedCommOperationException + public int getDivisor() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getDivisor()"); Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 26 Jun 2005 16:59:30 -0000 @@ -1877,16 +1877,27 @@ int fd = get_java_var( env, jobj,"fd","I" ); struct serial_struct sstruct; + if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) + { + goto fail; + } + + sstruct.baud_base = (int) BaudBase; + if ( sstruct.baud_base < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetBaudBase", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetBaudBase", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1914,9 +1925,13 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) ( sstruct.baud_base ) ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetBaudBase", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetBaudBase", strerror( errno ) ); @@ -1950,19 +1965,23 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } if ( sstruct.custom_divisor < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetDivisor", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetDivisor", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1971,7 +1990,7 @@ accept: none perform: Find the Divisor used for custom speeds - return: Divisor + return: Divisor negative value on error. exceptions: Unsupported Comm Operation on systems not supporting TIOCGSERIAL comments: @@ -1990,10 +2009,14 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) sstruct.custom_divisor ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetDivisor", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetDivisor", strerror( errno ) ); @@ -2032,7 +2055,7 @@ /* Open and lock the port so nothing else changes the setting */ - if ( LOCK( filename, pid ) ) goto fail;; + if ( LOCK( filename, pid ) ) goto fail; fd = find_preopened_ports( filename ); if( !fd ) Index: src/SerialPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/Attic/SerialPort.java,v retrieving revision 1.3.2.9 diff -u -r1.3.2.9 SerialPort.java --- src/SerialPort.java 12 Oct 2004 08:59:28 -0000 1.3.2.9 +++ src/SerialPort.java 26 Jun 2005 16:59:30 -0000 @@ -103,13 +103,17 @@ public abstract String getUARTType() throws UnsupportedCommOperationException; public abstract boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getBaudBase() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getDivisor() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setLowLatency() throws UnsupportedCommOperationException; public abstract boolean getLowLatency() cvs server: Diffing src/lfd cvs server: Diffing src/psmisc From uwe at kubosch.no Mon Jun 27 14:13:57 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Mon, 27 Jun 2005 22:13:57 +0200 Subject: [Rxtx] RXTX on FC4 Message-ID: <1119903238.2989.27.camel@BPC0276> Hi all! I just got RXTX to work on Fedora Core 4. The standard download did not work. I had to check the code out from CVS and build it, but then it worked flawlessly. Thanks for your good work. Now I wonder if I should contribute the compiled files so that others will have an easier time than me getting RXTX to work on FC4. What do I do? Who do I talk to? donV From taj at www.linux.org.uk Mon Jun 27 14:29:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 27 Jun 2005 21:29:46 +0100 (BST) Subject: [Rxtx] RXTX on FC4 In-Reply-To: <1119903238.2989.27.camel@BPC0276> References: <1119903238.2989.27.camel@BPC0276> Message-ID: On Mon, 27 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I just got RXTX to work on Fedora Core 4. > > The standard download did not work. > > I had to check the code out from CVS and build it, but then it worked > flawlessly. > > Thanks for your good work. > > Now I wonder if I should contribute the compiled files so that others > will have an easier time than me getting RXTX to work on FC4. What do I > do? Who do I talk to? > > The best thing to do with FC is to contibute an extras RPM. Debian does something like this with their .deb packaging. As rxtx is OS neutral, it is almost impossible to have everything on rxtx.org. If you do get a package in Fedora Extras, I can point a link there. The extra's mail list is here: https://www.redhat.com/mailman/listinfo/fedora-extras-list If it would help to have me release a 'stable' .tar.gz of the source for the RPM submittal process I can do that. It would also trigger upgrades in debian which would not be bad. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Mon Jun 27 16:23:20 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 27 Jun 2005 17:23:20 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: Message-ID: <42C07C58.1030608@atcorp.com> Hey Trent, I installed it and now I get IOExceptions instead of the other one. I'm not sure how those changes would have enabled setDivisor and setBaudBase to work though. Is it significant that this is a USB device emulating a serial port? ~ Shawn From taj at www.linux.org.uk Mon Jun 27 18:07:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 01:07:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: <42C07C58.1030608@atcorp.com> References: <42C07C58.1030608@atcorp.com> Message-ID: On Mon, 27 Jun 2005, Shawn Lavelle wrote: > Hey Trent, > I installed it and now I get IOExceptions instead of the other one. > I'm not sure how those changes would have enabled setDivisor and > setBaudBase to work though. Is it significant that this is a USB device > emulating a serial port? > The USB driver probably does not support this. With USB, the ioctl()'s appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through the linux drivers/usb tree and found to ioctl to support this in Linux 2.6.10. RXTX is not doing very much magic, the patch really only gets the serial struct instead of writing a structure with random values for baudbase and handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel level driver issue not a user space library issue. So if you wanted this to work, the usb serial driver would have to handle the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression after looking through the USB tree quickly. I hope that helps. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Jun 27 18:25:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 27 Jun 2005 20:25:22 -0400 Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) Message-ID: Hi All, I wrote: Jasmine: Is this working any better? And Jasmine says: Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) I am using -source 1.3 and -target 1.3 for the compilation, however, we still seem to have this problem, which my machine (for some reason) does not have. Does anyone have any ideas about what might be the problem? Thanks! - DL From taj at www.linux.org.uk Mon Jun 27 19:04:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 02:04:37 +0100 (BST) Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) In-Reply-To: References: Message-ID: On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I wrote: > Jasmine: Is this working any better? > > And Jasmine says: > Nope. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > > I am using -source 1.3 and -target 1.3 > for the compilation, however, we still seem to have this problem, > which my machine (for some reason) does not have. > Does anyone have any ideas about what might be the problem? > This has shown up in the past with jdk 1.5 compiled jars running on jre 1.4 machines. My guess is either jasmine has an old copy of rxtx with the problem on her machine that is being picked up on the classpath or you have not tried this with jre 1.4. The suggested -source/target fix should avoid the problem. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Mon Jun 27 21:23:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 04:23:55 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: On Tue, 28 Jun 2005, Trent Jarvi wrote: > On Mon, 27 Jun 2005, Shawn Lavelle wrote: > > > Hey Trent, > > I installed it and now I get IOExceptions instead of the other one. > > I'm not sure how those changes would have enabled setDivisor and > > setBaudBase to work though. Is it significant that this is a USB device > > emulating a serial port? > > > > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > > RXTX is not doing very much magic, the patch really only gets the serial > struct instead of writing a structure with random values for baudbase and > handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel > level driver issue not a user space library issue. > > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. > > I hope that helps. > > > It may be possible that you can just modify translate_speed and get_java_baudrate in SerialImp.c to have the new high speds you are after. The defines are in /usr/include/termios.h. #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 You can see many of these are not handled. I dont think CommAPI handled more than 57600 or so. int get_java_baudrate( int native_speed ) { switch( native_speed ) { case B0: return 0; case B50: return 50; case B75: return 75; case B110: return 110; case B134: return 134; case B150: return 150; case B200: return 200; case B300: return 300; case B600: return 600; case B1200: return 1200; case B1800: return 1800; case B2400: return 2400; case B4800: return 4800; case B9600: return 9600; case B19200: return 19200; case B38400: return 38400; case B57600: return 57600; default: return -1; } } int translate_speed( JNIEnv *env, jint speed ) { LEAVE( "RXTXPort:translate_speed" ); switch( speed ) { case 0: return B0; case 50: return B50; case 75: return B75; case 110: return B110; case 134: return B134; case 150: return B150; case 200: return B200; case 300: return B300; case 600: return B600; case 1200: return B1200; case 1800: return B1800; case 2400: return B2400; case 4800: return B4800; case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; #ifdef B57600 case 57600: return B57600; #endif /* B57600 */ #ifdef B115200 case 115200: return B115200; #endif /* B115200 */ #ifdef B230400 case 230400: return B230400; #endif /* B230400 */ #ifdef B460800 case 460800: return B460800; #endif /* B460800 */ #ifdef B14400 case 14400: return B14400; #endif /* B14400 */ #ifdef B28800 case 28800: return B28800; #endif /* B28800 */ #ifdef B128000 /* dima */ case 128000: return B128000; #endif /* dima */ #ifdef B256000 /* dima */ case 256000: return B256000; #endif /* dima */ } /* Handle custom speeds */ if( speed >= 0 ) return speed; else { LEAVE( "RXTXPort:translate_speed: Error condition" ); return -1; } } -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 28 05:20:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 28 Jun 2005 07:20:21 -0400 Subject: [Rxtx] cross-compilation using Make for Mac Message-ID: Hi All, Please excuse the long post; Trent said: >" >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. " Here is what I have on the mac version: java -version java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) When I run: http://show.docjava.com:8086/book/cgij/code/jnlp/math.benchmarks.Dhry.jnlp I get: -- listing properties -- jnlpx.heapsize=NULL,NULL jnlpx.splashport=-1 java.runtime.name=Java(TM) 2 Runtime Environment, Stand... java.protocol.handler.pkgs=com.sun.javaws.net.protocol sun.boot.library.path=/System/Library/Frameworks/JavaVM.fra... java.vm.version=1.4.2-38 awt.nativeDoubleBuffering=true gopherProxySet=false http.auth.serializeRequests=true java.vm.vendor="Apple Computer, Inc." java.vendor.url=http://apple.com/ path.separator=: java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io jnlpx.home=/Applications/Utilities/Java/Java Web... user.country=US sun.os.patch.level=unknown java.vm.specification.name=Java Virtual Machine Specification user.dir=/ java.runtime.version=1.4.2_05-141.4 java.awt.graphicsenv=apple.awt.CGraphicsEnvironment java.endorsed.dirs=/System/Library/Frameworks/JavaVM.fra... os.arch=ppc java.io.tmpdir=/tmp line.separator= java.vm.specification.vendor=Sun Microsystems Inc. jnlpx.remove=false os.name=Mac OS X sun.java2d.fontpath= java.library.path=/Applications/Utilities/Java/Java Web... java.specification.name=Java Platform API Specification java.class.version=48.0 jnlpx.deployment.user.home=/Users/lyon/Library/Caches/Java Web S... java.util.prefs.PreferencesFactory=java.util.prefs.MacOSXPreferencesFactory os.version=10.3.9 user.home=/Users/lyon user.timezone=America/New_York java.security.policy=file:/Applications/Utilities/Java/Jav... java.awt.printerjob=apple.awt.CPrinterJob trustProxy=true java.specification.version=1.4 file.encoding=MacRoman jnlpx.deployment.system.home=/Applications/Utilities/Java/J2SE 5.0... user.name=lyon java.class.path=/Applications/Utilities/Java/Java Web... java.vm.specification.version=1.0 sun.arch.data.model=32 java.home=/System/Library/Frameworks/JavaVM.fra... java.specification.vendor=Sun Microsystems Inc. user.language=en awt.toolkit=apple.awt.CToolkit java.vm.info=mixed mode java.version=1.4.2_05 java.ext.dirs=/Users/lyon/Library/Java/Extensions:/... sun.boot.class.path=/System/Library/Frameworks/JavaVM.fra... java.vendor=Apple Computer, Inc. file.separator=/ java.vendor.url.bug=http://developer.apple.com/java/ sun.cpu.endian=big sun.io.unicode.encoding=UnicodeBig mrj.version=141.3 jnlpx.jvm=/System/Library/Frameworks/JavaVM.fra... sun.cpu.isalist= sun.awt.exception.handler=apple.awt.CToolkit$EventQueueExceptio... javawebstart.version=javaws-1.4.2_05 800 mhz g4,878k ds/sec total time: 1184ms Result: 844594 dhrystone/sec. Load average for last 15 minutes:0.62 So, I feel pretty sure that I have tried this with 1.4. As to modifying the RXTX compilation, that I did not do...and I take your point. I have been using the binary distributions as is. Oops. I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Now when I do a make, I get: make gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known libtool: link: warning: undefined symbols not allowed in i386-pc-mingw32 shared libraries rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ln: `SerialImp.o': File exists make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 So, I do a make clean, then a make: .... (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ar cru .libs/librxtxSerial.a /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o ar: /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o: No such file or directory make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 In the i386 directory, there is a symbolic link left from something: ls -al SerialImp.o lrwxrwxrwx 1 lyon lyon 12 Jun 28 07:03 SerialImp.o -> SerialImp.lo However, the SerialImp.lo is not present (which is the cause of the error, I think). On the other hand, the file I am looking for is present in: i686-pc-linux-gnu Possibly the i386 generation is not clean (of course it is also likely that I am just asking dumb questions, being a newbie to the code and all.). Finally, will this make file regenerate the distro for the mac? I found some really old (from year 2001) files in: cvs/MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions Which I could use for the distro...but I would prefer to do a clean, multi-platform build from make. Thanks! - Doug >On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > >> Hi All, >> I wrote: >> Jasmine: Is this working any better? >> >> And Jasmine says: >> Nope. >> >> An error occurred while launching/running the application. >> >> Title: addbk.JAddressBook.Main >> Vendor: DocJava, Inc. >> Category: Unexpected Error >> >> gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) >> >> > > I am using -source 1.3 and -target 1.3 >> for the compilation, however, we still seem to have this problem, >> which my machine (for some reason) does not have. >> Does anyone have any ideas about what might be the problem? >> > >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. > > >The suggested -source/target fix should avoid the problem. > >-- >Trent Jarvi >tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 28 09:43:41 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 28 Jun 2005 10:43:41 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: <42C1702D.1070307@atcorp.com> > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. There is ioctl stuff in the driver for the chip, but i haven't seen the TIOC*SERIAL entries. That might be why it continues to fail. I did get around the problem, though, by hacking the driver and just specifying the baud rate I need. Now everything works well. Thanks for all the assistance you've provided. ~ Shawn M. Lavelle From taj at www.linux.org.uk Tue Jun 28 12:42:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:42:29 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known Add a compiler flag -DWIN32 The code above should not be compiling on w32 as it is #if !defined(WIN32) You can look at the bottom of Makefile.in to see the w32 compile flags. Search for "WIN32 CrossCompiling from here down" If its still not working, I can set you up with the Bob account. Just email me off the list. W32 compiling is a bit complicated. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 28 12:52:50 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:52:50 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Nods. I did change configure but right now it is only in the baudbase/divisor patch I posted. I'm going to add several extension baud rates that can be supported by normal API calls and commit that today as a followup to my comments yesterday on baudrates. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Wed Jun 29 01:52:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 08:52:10 +0100 (BST) Subject: [Rxtx] [PATCH] More baud rate fixes Message-ID: I went through the native baudrate conversion from Java and added several. This patch is against CVS 2.1 head. I think thats it for baud rate fixes unless someone see something. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- A non-text attachment was scrubbed... Name: baud_base_and_divisor_plus_odd_baudrates.diff.gz Type: application/x-gzip Size: 3291 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050629/4c1ef1c2/baud_base_and_divisor_plus_odd_baudrates.diff-0006.gz From lyon at docjava.com Wed Jun 29 10:33:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 29 Jun 2005 12:33:45 -0400 Subject: [Rxtx] java.comm dependencies Message-ID: Hi All, During a build of the rxtx code, I have left the javax.comm out of the system (on purpose). However, I get an error, at run time: CommPortIdentifier:static initialization() apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: javax/comm/CommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver I am thinking that there is something in the gnu.io.CommPortIdentifier that seeks to load the javax.comm.CommDriver. It was my understanding that we could write code without reference to the javax.comm.CommDriver and that we could work in the gnu namespace. Is this true? Thanks! - Doug From taj at www.linux.org.uk Wed Jun 29 11:16:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 18:16:08 +0100 (BST) Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > During a build of the rxtx code, I have left the > javax.comm out of the system (on purpose). > However, I get an error, at run time: > > CommPortIdentifier:static initialization() > apple.awt.EventQueueExceptionHandler Caught Throwable : > java.lang.NoClassDefFoundError: javax/comm/CommDriver > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > that seeks to load the javax.comm.CommDriver. > > It was my understanding that we could write code without reference > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > Is this true? > Yes. People use 2.1 without javax all the time. There should be no reference to javax at all in rxtx 2.1. You may check your code. I just did a grep through 2.1 and there is nothing. You may look at the classes you are using. If you find javax.comm in your code, replace it with gnu.io and that should be all you need to do. -- Trent Jarvi tjarvi at qbang.org From jayant28k at gmail.com Wed Jun 29 21:49:28 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Thu, 30 Jun 2005 09:19:28 +0530 Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: <6a6a02310506292049778c452f@mail.gmail.com> Trent, I think best idea is to have wiki for rxtx code. So as the traffic is increasing with time. "RXTX" seems to be more popular in embbeded system. Sun Microsystems will always apperciate your efforts on parallel and serial ports commincation based application in IT Industry. Thanks for your help on this forum as "ONE MAN ARMY" ;-) Cheers, Jayant On 6/29/05, Trent Jarvi wrote: > On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > > > Hi All, > > During a build of the rxtx code, I have left the > > javax.comm out of the system (on purpose). > > However, I get an error, at run time: > > > > CommPortIdentifier:static initialization() > > apple.awt.EventQueueExceptionHandler Caught Throwable : > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > > that seeks to load the javax.comm.CommDriver. > > > > It was my understanding that we could write code without reference > > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > > > Is this true? > > > > Yes. People use 2.1 without javax all the time. > > There should be no reference to javax at all in rxtx 2.1. You may check > your code. I just did a grep through 2.1 and there is nothing. You may > look at the classes you are using. > > If you find javax.comm in your code, replace it with gnu.io and that > should be all you need to do. > > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From uwe at kubosch.no Sat Jun 25 02:50:24 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Sat, 25 Jun 2005 10:50:24 +0200 Subject: [Rxtx] RXTX in FC3/FC4 Message-ID: <1119689424.12606.14.camel@BPC0276> Hi all! I am trying to get RXTX to work on Fedora Core, version 3 or 4. I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext directory. I have edited the jre/lib/javax.comm.properties according to the docs. I have tried this with both rxtx 2.0 and 2.1. I have tried on two different machines. I have tried with java 1.4.2 and java 1.5.0, both from Sun. I always get a signall 11 from the native libraries when they are loaded. Is this a common problem? Any help is greatly appreciated. Below is the start of the error message. More can be supplied on demand. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x65015A Function=(null)+0x65015A Library=/lib/ld-linux.so.2 NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) - locked <0xed46f628> (a java.util.Vector) - locked <0xed471708> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xed46ebc0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.InitializeDriver(CommPortIdentifier.java:213) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:248) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:351) at com.jpeterson.x10.module.CM11A.allocate(CM11A.java:1160) at net.sourceforge.cruisecontrol.publishers.X10Publisher.send(X10Publisher.java:182) at net.sourceforge.cruisecontrol.publishers.X10Publisher.turnOff(X10Publisher.java:171) at net.sourceforge.cruisecontrol.publishers.X10Publisher.handleBuild(X10Publisher.java:148) at net.sourceforge.cruisecontrol.publishers.X10Publisher.publish(X10Publisher.java:141) at net.sourceforge.cruisecontrol.Project.publish(Project.java:679) at net.sourceforge.cruisecontrol.Project.build(Project.java:227) at net.sourceforge.cruisecontrol.Project.execute(Project.java:153) at net.sourceforge.cruisecontrol.ProjectWrapper.run(ProjectWrapper.java:66) at java.lang.Thread.run(Thread.java:534) From chris_jh at blueyonder.co.uk Tue Jun 28 05:37:10 2005 From: chris_jh at blueyonder.co.uk (Christopher Harris) Date: Tue, 28 Jun 2005 12:37:10 +0100 Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError Message-ID: <42C13666.9030108@blueyonder.co.uk> Hi I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 32bit) The serial ports work fine with no issues, but when i try to use the parallel port i get this message Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:66) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) I am trying to print a line out to port "/dev/lp0" At first i thought it could not find the librxtxParallel.so file, but when i renamed it i got a different saying it could not find the library. I have tried to run as root no difference. It is really weird, i get no compile errors and the serial ports work fine. I changed the LPRPort.java and commented out the Initialize call method. And just get the same error but for the method open. It is as though it can't see the methods, and yet it can see the library. I did have a bit of check of the JNI implementation in rxtx but could not spot anything. Yours Thankfully Christopher Harris From lyon at docjava.com Thu Jun 30 02:28:09 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 04:28:09 -0400 Subject: [Rxtx] tools Message-ID: Hi All, I have been thinking about automatic cross-platform native method development of Java/C programs. It appears that different binary tools are needed to target different platforms. Configuration seems a bit painful. Is there something better available than make? Is ANT any good at this? Has anyone tried: http://jnipp.sourceforge.net/ Thanks! - Doug From lyon at docjava.com Thu Jun 30 04:11:17 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 06:11:17 -0400 Subject: [Rxtx] javax.comm Message-ID: Hi All, When I load my jar files on a linux box, all is well. However, when I load them on a mac, I get: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver The jar files for the mac are different from the jar files for linux, because recompilation of the native code for the mac has not been easy, for me. As a result, the RXTX jars are tending toward specific versions and platforms. Probably, this is not an ideal situation, but, I suspect, it is common. I have an idea that we could create a single JNLP distro site that we can make reference to that would enable a uniform repository of synchronized signed native methods and jars for RXTX. For example, the one-wire Maxim folks have a real-nice approach where their stuff makes reference to another JNLP file that contains all the stuff we need to make RXTX work. Check it out at: http://www.maxim-ic.com/products/ibutton/software/1wire/OneWireViewer.cfm However, even they have problems on an unconfigured machine: Specified adapter name "DS9097U" is not known * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cannot load default adapter. Please check that the adapter is connected and that no other application is using the port. If you have checked the adapter, the default port might not be selected. Either set the value of the TMEX default using the utility provided with the TMEX Runtime, or create a new file in the /lib folder called onewireviewer.properties with two lines, similar to the following: #native win32 drivers adapter.name={DS9097U} adapter.port=COM1 #or javax.comm drivers adapter.name=DS9097U adapter.port=COM1 The full path to this file should be: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/onewireviewer.properties ---- Wow, that is a show stopper! Configuration is something that we really need to think about as an automatic thing, particularly for web start users. You can't ask a person who wants to run an application to figure out how to alter a properties file. If you know you need one, then get permission and make one...automatically. That makes a lot of sense, to me. Basically, we need an installer. At the very least, all the pre-built binaries and jars needed for the RXTX package on several platforms should be available from a single place. One this happens, we can make a JNLP file that is platform specific, but can give us a level of indirection. Is this something that has been done already? Thanks! - Doug From taj at www.linux.org.uk Thu Jun 30 08:10:22 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 15:10:22 +0100 (BST) Subject: [Rxtx] tools In-Reply-To: References: Message-ID: On Thu, 30 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I have been thinking about automatic cross-platform > native method development of Java/C programs. > > It appears that different binary tools are needed to target different > platforms. Configuration seems a bit painful. > > Is there something better available than make? > > Is ANT any good at this? I'm far from an Ant expert but have used it for other projects. The main problem I see with ant is there is no mainstream support for platform neutral neutral library creation as far as I can tell. I think ant is a fine replacement for make but I've not seen a suitable replacement for autoconf. At that point, make is as good as anything. It should be possible to create a ant build.xml that works on say Solaris, Linux, Windows and Mac OS X. The problem is when you are trying to build a library for embeded ARM from Mac OS X. > Has anyone tried: > http://jnipp.sourceforge.net/ -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:22:02 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:22:02 +0100 (BST) Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <1119689424.12606.14.camel@BPC0276> References: <1119689424.12606.14.camel@BPC0276> Message-ID: On Sat, 25 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I am trying to get RXTX to work on Fedora Core, version 3 or 4. > > I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 > directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext > directory. > > I have edited the jre/lib/javax.comm.properties according to the docs. > > I have tried this with both rxtx 2.0 and 2.1. > > I have tried on two different machines. > > I have tried with java 1.4.2 and java 1.5.0, both from Sun. > > I always get a signall 11 from the native libraries when they are > loaded. Is this a common problem? Any help is greatly appreciated. > Below is the start of the error message. More can be supplied on > demand. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x65015A > Function=(null)+0x65015A > Library=/lib/ld-linux.so.2 > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) If you compile rxtx from source, this will probably go away. I'm not sure what the exact cause is but it looks like the binaries are not suitable for FC3/4. The ABI may have changed since those had been compiled. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:26:56 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:26:56 +0100 (BST) Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError In-Reply-To: <42C13666.9030108@blueyonder.co.uk> References: <42C13666.9030108@blueyonder.co.uk> Message-ID: tOn Tue, 28 Jun 2005, Christopher Harris wrote: > Hi > > I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 > 32bit) > > The serial ports work fine with no issues, but when i try to use the > parallel port i get this message > > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:66) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) > > > I am trying to print a line out to port "/dev/lp0" > > At first i thought it could not find the librxtxParallel.so file, but > when i renamed it i got a different saying it could not find the library. > > I have tried to run as root no difference. > > It is really weird, i get no compile errors and the serial ports work fine. > > I changed the LPRPort.java and commented out the Initialize call method. > And just get the same error but for the method open. > > It is as though it can't see the methods, and yet it can see the library. > I did have a bit of check of the JNI implementation in rxtx but could > not spot anything. > > > You can check if the symbols are in the shared library: nm librxtxSerial.so |grep Initialize If the symbols are not there, there was a build error. Watch very close for build errors while compiling from source. I suspect something isnt behaving right. -- Trent Jarvi tjarvi at qbang.org From allen at adbyrne.us Thu Jun 30 06:55:58 2005 From: allen at adbyrne.us (Allen Byrne) Date: Thu, 30 Jun 2005 07:55:58 -0500 Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> References: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> Message-ID: <200506300755.59159.allen@adbyrne.us> On Thursday 30 June 2005 00:31, rxtx-request at mail.electronpusher.org wrote: > >Message: 8 >Date: Sat, 25 Jun 2005 10:50:24 +0200 >From: Uwe Kubosch >Subject: [Rxtx] RXTX in FC3/FC4 >To: rxtx at mail.electronpusher.org >Message-ID: <1119689424.12606.14.camel at BPC0276> >Content-Type: text/plain > >Hi all! > >I am trying to get RXTX to work on Fedora Core, version 3 or 4. > >I have tried this with both rxtx 2.0 and 2.1. > >I have tried on two different machines. > >I have tried with java 1.4.2 and java 1.5.0, both from Sun. > >I always get a signall 11 from the native libraries when they are >loaded. ?Is this a common problem? ?Any help is greatly appreciated. >Below is the start of the error message. ?More can be supplied on >demand. > >An unexpected exception has been detected in native code outside the VM. >Unexpected Signal : 11 occurred at PC=0x65015A >Function=(null)+0x65015A >Library=/lib/ld-linux.so.2 > I had thi same problem on SUSE9.3 and java 1.5.0. After searching through the archives, I found a patch that required adding a sleep(1000) command in two functions of SerialIO.java. This only was for rxtx2.1, I had no trouble with rxtx2.0. Note, also I had to add the "|1.5*" sequence to the configure.in file to get good *.so libs. Again 2.0 was fine. -- Allen Byrne adbyrne at ieee.org http://modelrr.adbyrne.us From taj at www.linux.org.uk Fri Jun 3 01:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 08:57:29 +0100 (BST) Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 3 09:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 16:57:53 +0100 (BST) Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi at qbang.org From jasmine at electronpusher.org Fri Jun 3 10:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 17:12:21 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 11:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:02:09 +0100 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 11:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:05:10 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From jon.nall at gmail.com Mon Jun 6 09:13:58 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 10:13:58 -0500 Subject: [Rxtx] StackOverflowError Message-ID: I have a fairly small application that is communicating to a microcontroller programmer at 115.2k. I have a test where I try and dump the memory of the microcontroller (whose size is 8k and change). Things are going smoothly and the data looks good. Then after reading out ~6.5k of data, I get a StackOverflowError. The stack trace looks like: CommInterface.serialEvent(): 324 // this is my code RXTXPort.sendEvent(): 732 RXTXPort.eventLoop() [Native] MonitorThread.run(): 1531 I am running on windows and using rxtx-2.1-CVS-20050120. When I increased the stack size to 512k, I could read the entire chip without issue. But that doesn't seem like the right thing to do without root causing what's happening. My code doesn't include any recursion and the stack trace looks terribly short, so I'm a bit confused as to why I'm getting a StackOverflowError. CommInterface.serialEvent() does little more than grab the available bytes, enter a synchronized block, stick them in a common data area for the main thread to use and leave the synchronization block. I guess my question is: are there any known issues with the default stack size when using the latest rxtx on windows? thanks, nall. From taj at www.linux.org.uk Mon Jun 6 09:27:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 16:27:34 +0100 (BST) Subject: [Rxtx] StackOverflowError In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > I have a fairly small application that is communicating to a > microcontroller programmer at 115.2k. I have a test where I try and > dump the memory of the microcontroller (whose size is 8k and change). > Things are going smoothly and the data looks good. Then after reading > out ~6.5k of data, I get a StackOverflowError. The stack trace looks > like: > > CommInterface.serialEvent(): 324 // this is my code > RXTXPort.sendEvent(): 732 > RXTXPort.eventLoop() [Native] > MonitorThread.run(): 1531 > > I am running on windows and using rxtx-2.1-CVS-20050120. When I > increased the stack size to 512k, I could read the entire chip without > issue. But that doesn't seem like the right thing to do without root > causing what's happening. My code doesn't include any recursion and > the stack trace looks terribly short, so I'm a bit confused as to why > I'm getting a StackOverflowError. > > CommInterface.serialEvent() does little more than grab the available > bytes, enter a synchronized block, stick them in a common data area > for the main thread to use and leave the synchronization block. > > I guess my question is: are there any known issues with the default > stack size when using the latest rxtx on windows? > This is the first I've heard of the problem. It is strange as you mention lookin at the stack trace. That cant be taking up too much space. If you just toss the data instead of trying to put it in your work area, does it persist? -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Mon Jun 6 10:09:39 2005 From: lengyel at gmail.com (FL) Date: Mon, 6 Jun 2005 12:09:39 -0400 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on which the jdk1.5.0_03 is installed. I found that the INSTALL documentation seems to be in error. It states that javacomm20-x86.tar.Z (the Java Communications API for Solaris/x86) must be used, in fact this choice led to the following test with theBlackBox sample program in the commapi: root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG BlackBox -p /dev/ttyS0 Port /dev/ttyS0 not found! No serial ports found! Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to cause Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to the Eclipse stable build version 3.1M7 to avoid this. However, I found that using the Solaris/Sparc version of commapi worked on my system. I have documented this on: http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050606/b28fb9a7/attachment-0007.html From taj at www.linux.org.uk Mon Jun 6 10:30:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:30:27 +0100 (BST) Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, FL wrote: > I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on > which the jdk1.5.0_03 is installed. I found that the INSTALL documentation > seems to be in error. It states that javacomm20-x86.tar.Z (the Java > Communications API for Solaris/x86) must be used, in fact this choice led to > the following test with theBlackBox sample program in the commapi: > > root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG > BlackBox -p /dev/ttyS0 > Port /dev/ttyS0 not found! > No serial ports found! > > Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to > cause > Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to > the Eclipse stable build version 3.1M7 to avoid this. > > However, I found that using the Solaris/Sparc version of commapi > worked on my system. > > I have documented this on: > > http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 > Thanks FL. I'll change the documentation to point to the SPARC comm.jar. In the past, any Solaris was good enough, we tried to avoid the w32 comm.jar because it made native calls rxtx would never implement on any OS as they are not platform neutral. I'll withold comments about Sun's comm.jar being different on various CPUs within even the same OS. RXTX 2.1 does not need to do that even acrossed OSs for instance. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 6 10:35:43 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 11:35:43 -0500 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API Message-ID: It seems that Sun's javax.comm site does not include JavaDoc'ed API and the RxTx site has the API, but no real documentation. Is there some site that i'm just missing in my google searches? I'm looking for a copy of the javax.comm API which is documented. Thanks, nall. From taj at www.linux.org.uk Mon Jun 6 10:44:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:44:03 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > It seems that Sun's javax.comm site does not include JavaDoc'ed API > and the RxTx site has the API, but no real documentation. Is there > some site that i'm just missing in my google searches? I'm looking for > a copy of the javax.comm API which is documented. > > Thanks, > nall. Sun's version is with their binary downloads. RXTX tries to match that so I never bothered with more complete JavaDocs. Whatever Sun documents is what we try to do. -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Mon Jun 6 12:13:44 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 6 Jun 2005 14:13:44 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: Message-ID: <20050606181245.528C929D56F@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Trent Jarvi > Sent: Monday, June 06, 2005 12:44 PM > To: Jon Nall; Java RXTX discussion > Subject: Re: [Rxtx] Where can I find JavaDoc on the javax.comm API > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > It seems that Sun's javax.comm site does not include JavaDoc'ed API > > and the RxTx site has the API, but no real documentation. Is there > > some site that i'm just missing in my google searches? I'm > looking for > > a copy of the javax.comm API which is documented. > > > > Thanks, > > nall. > > Sun's version is with their binary downloads. RXTX tries to > match that so I never bothered with more complete JavaDocs. > Whatever Sun documents is what we try to do. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Try http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht ml -Ack From gadelavega at yahoo.com.ar Mon Jun 6 12:58:09 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Mon, 6 Jun 2005 15:58:09 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606181245.528C929D56F@mail.electronpusher.org> Message-ID: <20050606185809.57069.qmail@web14603.mail.yahoo.com> --- "David S. Acker" escribi?: > > -----Original Message----- > > From: rxtx-bounces at mail.electronpusher.org > > [mailto:rxtx-bounces at mail.electronpusher.org] On > Behalf Of Trent Jarvi > > Sent: Monday, June 06, 2005 12:44 PM > > To: Jon Nall; Java RXTX discussion > > Subject: Re: [Rxtx] Where can I find JavaDoc on > the javax.comm API > > > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > > > It seems that Sun's javax.comm site does not > include JavaDoc'ed API > > > and the RxTx site has the API, but no real > documentation. Is there > > > some site that i'm just missing in my google > searches? I'm > > looking for > > > a copy of the javax.comm API which is > documented. > > > > > > Thanks, > > > nall. > > > > Sun's version is with their binary downloads. > RXTX tries to > > match that so I never bothered with more complete > JavaDocs. > > Whatever Sun documents is what we try to do. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > Try > http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > ml > -Ack > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > I'm prety sure it was there... but not anymore. Gonzalo A. de la Vega, BI ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From taj at www.linux.org.uk Mon Jun 6 18:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 01:09:14 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606185809.57069.qmail@web14603.mail.yahoo.com> References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: >> http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > > I'm prety sure it was there... but not anymore. > It is there. Maybe the URL got mangled. Try this http://tinyurl.com/8dfp7 It just redirects you to: http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.html -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 7 05:46:39 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Jun 2005 07:46:39 -0400 Subject: [Rxtx] rxtx under fedora - odd procedures Message-ID: Hi All, I was able to get RXTX communications to work under Fedora, but only after I added myself to the UUCP and LOCK groups, logged out and then logged back in. Both groups appear to be needed in order to access the serial ports. Also the group alter did not take until after I logged out and logged back in. My theory is that you need permission to write to the var/spool directory under fedora and that this is the only way to do it. Logging out and logging back in just seems like an odd thing to do. I suppose some users may have to restart X. Ouch! Is this true? The alter_group command indicates that you need to be an su to alter the group database. Does this mean that my serial port users need a database su able person to use serial port applications under RXTX? If so, what is the procedure to make a transparent install work using Java web start? Should I be prompting users for the su password? Should I be telling users to exit from X and log out? Is this the way other serial communications programs work? Thanks! - Doug From sean_montgomery at baseview.com Tue Jun 7 08:14:51 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 7 Jun 2005 10:14:51 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: >>> http://java.sun.com/products/javacomm/javadocs/javax/comm/package- >>> summary.ht >>> > > >> >> I'm prety sure it was there... but not anymore. >> >> > > It is there. Maybe the URL got mangled. Try this > > http://tinyurl.com/8dfp7 > > It just redirects you to: > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > summary.html > Maybe the issue here is that the info is available without frames from that URL, but when you try to access it with frames (from the link on that page) it doesn't work - it takes you to: http://java.sun.com/products/javacomm/javadocs/index.html Which doesn't have anything useful on it. From gadelavega at yahoo.com.ar Tue Jun 7 08:22:50 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:22:50 -0300 (ART) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: Message-ID: <20050607142251.92850.qmail@web14626.mail.yahoo.com> --- "Dr. Douglas Lyon" escribi?: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the > group > alter did not take until after I logged out and > logged back in. > > My theory is that you need permission to write to > the var/spool > directory under fedora and that this is the only way > to do it. > > Logging out and logging back in just seems like an > odd thing to > do. I suppose some users may have to restart X. > Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port > applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log > out? > Is this the way other serial communications programs > work? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Actually, you need the lock group to acces /var/lock directory, and uucp to acces /dev/ttyS*. You (as root) shuold add all users you will allow to use the serial ports to group uucp and all the ones you'll allow to lock the ports to lock group (rxtx needs both). This is not only for rxtx, but for any use of the serial ports. Next time they login they'll be able to work, so if they are in they'll have to log out first. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From gadelavega at yahoo.com.ar Tue Jun 7 08:23:56 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:23:56 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> Message-ID: <20050607142356.93815.qmail@web14624.mail.yahoo.com> --- Sean Montgomery escribi?: > > On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: > > >>> > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > >>> summary.ht > >>> > > > > > >> > >> I'm prety sure it was there... but not anymore. > >> > >> > > > > It is there. Maybe the URL got mangled. Try this > > > > http://tinyurl.com/8dfp7 > > > > It just redirects you to: > > > > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > > summary.html > > > > Maybe the issue here is that the info is available > without frames > from that URL, but when you try to access it with > frames (from the > link on that page) it doesn't work - it takes you > to: > > http://java.sun.com/products/javacomm/javadocs/index.html > > Which doesn't have anything useful on it. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > That's right, my bad. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From jon.nall at gmail.com Tue Jun 7 08:33:40 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 09:33:40 -0500 Subject: [Rxtx] performance expectations Message-ID: Hi all. I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC microcontroller. The protocol I'm using (which I didn't create) looks like this for the section of code I'm concerned with: PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data PIC -> PC: 0x01 // ACK 0xNN // First 8 bits of data 0xMM // Second 8 bits of data I issue ~2000 of these Read commands. The PIC itself has an input fifo which can store 18 bytes, so I can have 18 read commands in flight at a given time. The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k 8N1. I am measuring the time it takes to perform these 2000 commands at around 30 seconds, which is much longer than I anticipated. With the link fully utilized, I expected: Time per byte transmitted: 115200 / 8 = 14400 bytes/second = ~70 uS/byte Time per response transmitted: ~70 uS/byte * 3 bytes/response = ~210 uS/response Time for 2000 responses to be transmitted: ~210 uS/response * 2000 responses = ~420ms I'm a bit new to this, so I may have made some bad asumptions, but I would have expected a time of a couple of seconds to perform the 2000 reads, not 30+ seconds. I'm obviously missing something here. Can someone help me understand what's going on? Thanks, nall. From taj at www.linux.org.uk Tue Jun 7 09:17:48 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:17:48 +0100 (BST) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the group > alter did not take until after I logged out and logged back in. > > My theory is that you need permission to write to the var/spool > directory under fedora and that this is the only way to do it. > > Logging out and logging back in just seems like an odd thing to > do. I suppose some users may have to restart X. Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log out? > Is this the way other serial communications programs work? > RIght now, rxtx requires you do one of two things. 1) Use lock files (recommended). This requires intervention by the root users to allow users to create lock files and open the ports as you note. 2) configure rxtx with --disable-lockfiles. In this case you need only worry about the permissions on /dev/ttyS* I'm not sure what the default on Fedora is with respect to permisions. This is not very attractive. There is a better way it could be done on Fedora. Fedora comes with lockdev library. I've been considering this for some time. We could use that for the locking and do away with many of the problems. The problem is embeded devices running Linux do not come with liblockdev. But for your use, I would consider adding a new option for locking serial devices using liblockdev. lockdev-devel has a man page with further information. SYNOPSIS #include pid_t dev_testlock( const char * devname); pid_t dev_lock( const char * devname); pid_t dev_relock( const char * devname, pid_t pid); pid_t dev_unlock( const char * devname, pid_t pid); cc [ flag ... ] file ... -llockdev [ library ] This would probably need to be a configure time option to prevent problems on embeded Linux devices but could otherwise be the default on Linux. I could toss a quick patch together if this is confusing. It is actually easier than what rxtx does now. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 09:27:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:27:11 +0100 (BST) Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > Hi all. > I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC > microcontroller. The protocol I'm using (which I didn't create) looks like this > for the section of code I'm concerned with: > > PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data > PIC -> PC: 0x01 // ACK > 0xNN // First 8 bits of data > 0xMM // Second 8 bits of data > > I issue ~2000 of these Read commands. The PIC itself has an input fifo which > can store 18 bytes, so I can have 18 read commands in flight at a given time. > The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k > 8N1. > > I am measuring the time it takes to perform these 2000 commands at around 30 > seconds, which is much longer than I anticipated. With the link fully utilized, > I expected: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte > > Time per response transmitted: > ~70 uS/byte * 3 bytes/response = ~210 uS/response > > Time for 2000 responses to be transmitted: > ~210 uS/response * 2000 responses = ~420ms > > I'm a bit new to this, so I may have made some bad asumptions, but I would have > expected a time of a couple of seconds to perform the 2000 reads, not 30+ > seconds. > > I'm obviously missing something here. Can someone help me understand what's > going on? > I've hooked rxtx in loopback with a scope in the past at 9600 baud (baud rate is not important). Using event notification and just writing a byte on event/read the latencey was around 8-12 ms. The JNI is not an efficient way to use native code - especially for bit banging. So if timing is critical you want to move some of the logic into the native code rather than banging over the JNI. 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your performance. C# has advantages here. If you move your logic into the native layer or use gcj (rxtx will work with that too) most of your latency should vanish. You may have to play with some sleeps in eventLoop at that point to get full native efficiency. With gcj all of rxtx becomes 'native code' as java is just treated as a subset of C++. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 09:38:51 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 10:38:51 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: On 6/7/05, Jon Nall wrote: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte of course that should be divided by 10 to account for the start/stop bits, but it barely changes the end results. From carobizar at free.fr Tue Jun 7 10:21:29 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 7 Jun 2005 18:21:29 +0200 Subject: [Rxtx] (no subject) Message-ID: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Hello ! I am a french student and I have to create an application able to read and write on serial and parallel port and to run on Windows and Linux. For the moment my program run on Windows thanks the Java Communication API (version for Microsoft Windows and Solaris/x86). But it doesn't work on Linux. Does a recent version of an installation documentation exist ? I didn't find one on the RXTX site (nothing for the windows installation and the linux installation deals with a "jcl.jar" that I don't know...). So, I have some questions : 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 version or Linux&w32 version ?) What are the differences between them ? Which of them are the most stable ? 2) Where have I to put the .so and .dll files ? 3) What have I to write on the file javax.comm.properties ? 4) Have I to delete the file win32comm.dll included in the Java Comm API ? 5) Have I to keep both comm.jar and RXTXcomm.jar ? Best regards, Caroline. From debief at telemsa.com Tue Jun 7 10:44:56 2005 From: debief at telemsa.com (DEBIEF Eric) Date: Tue, 7 Jun 2005 18:44:56 +0200 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: <200506071844.56656.debief@telemsa.com> Hi, We are "pushing" RxTx /Java here in a half-duplex link. The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC and application handling) about 25?s/byte. The figures are the barely the same on two environments. Environment 1 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Linux 2.6.3, Mdk 10.0. RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : bytes are lost on the wire. I need to investigate this mystery.... Java : 1.4.2-rc1 Blackdown Environment 2 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Windows 2000 Pro RxTx : 2.0.7. Java : 1.4.2_08 SUN I Hope this help, Eric. _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 7 11:05:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:05:45 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, DEBIEF Eric wrote: > Hi, > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. How many write() calls is this? > > Environment 1 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Linux 2.6.3, Mdk 10.0. > RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : > bytes are lost on the wire. I need to investigate this mystery.... > Java : 1.4.2-rc1 Blackdown > > Environment 2 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Windows 2000 Pro > RxTx : 2.0.7. > Java : 1.4.2_08 SUN > In my event/read/write test I found windows was ~20% faster than linux for some reason (strange part is Windows was in VMWare on the same Linux machine). It was about the same rxtx version. There are many problems with rxtx 1.4 with respect to commapi on windows but its code paths are more simple. What some people want from rxtx is perhaps better served by hacking up the very first release as they just want to read and write which is what rxtx was before Sun released commapi. It sounds like perhaps you are pushing out larger writes which will greatly improve results. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 11:16:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:16:49 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118161289.42a5c989cf6a2@imp4-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: On Tue, 7 Jun 2005 carobizar at free.fr wrote: > > Hello ! > > I am a french student and I have to create an application able to read and write > on serial and parallel port and to run on Windows and Linux. > For the moment my program run on Windows thanks the Java Communication API > (version for Microsoft Windows and Solaris/x86). > But it doesn't work on Linux. > > Does a recent version of an installation documentation exist ? > I didn't find one on the RXTX site (nothing for the windows installation and the > linux installation deals with a "jcl.jar" that I don't know...). > > So, I have some questions : > > 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 > version or Linux&w32 version ?) What are the differences between them ? Which > of them are the most stable ? > Use rxtx 2.0 with commapi for sparc solaris from Sun. If you want your current package javax.comm. > 2) Where have I to put the .so and .dll files ? On Linux just use the source, the configure script will do all of that for you. tar -xzvf rxtx-2.0-version mkdir rxtx-2.0-version/build cd rxtx-2.0-version/build ../configure && make install It will do everything for you. With Windows, you need to create the javax.comm.properties and install the DLL on your path. But you can just use Sun's package too. They are intended to be interchangable. > > 3) What have I to write on the file javax.comm.properties ? Driver=gnu.io.RXTXCommDriver More documentation in INSTALL that comes with the source. Sun's documentation should work too. configure does this for you on Linux. > > 4) Have I to delete the file win32comm.dll included in the Java Comm API ? > No > 5) Have I to keep both comm.jar and RXTXcomm.jar ? > Yes. RXTX 2.1 replaces comm.jar but the package is different (gnu.io) to avoid contaminating Sun's namespace. With rxtx 2.0 you need Sun's comm.jar - they work together. > > Best regards, > Caroline. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Tue Jun 7 12:07:34 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 14:07:34 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 Message-ID: <20050607180632.1543A29D5C8@mail.electronpusher.org> Hello, I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our product includes a built in USB to Serial adapter so that when it is connected to your PC over USB, it appears as a serial port. We had problems with Sun's comm library because it did not detect serial ports coming and going properly. I did run into a few issues with RxTx though. I am building under Windows (we support XP and 2000) under cygwin. I used a simple make file for the c code that works under cygwin and ant to build the java stuff. Attached is a diff file. The patches hit the following issues: ParallelImp.c - I am not using config so there is no config.h for me. Also, gcc didn't like a local file (win32termios.h) getting included with <> . RXTXPort.java - You can get an exception during the writeByte, writeArray, nativeDrain, readByte, read, readArray, readTerminatedArray, and nativeAvailable calls. Without this patch the IOLocked count gets stuck incremented. termios.c - If you try to open a port through CreateFile and get ERROR_ACCESS_DENIED it means someone else is using the port. We need to make sure to use serial_close instead of just close. I found that some devices finish their I/O synchronously. The code was treating this as an error. I also added some checking on the ClearError calls. I found a compile error when debugging is turned on (see the usleep change). SerialImp.c - Again, I don't have a config.h and again we must use quotes and not <> to include win32termios.h . I also commented out a report call since it seems to happen constantly on my system. Feel free to use these in any way that you want or just to ignore them. Thanks! -Dave Acker dacker at nomadio.net Software Engineer Nomadio, Inc. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diffs.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/5671d159/diffs-0007.txt From jon.nall at gmail.com Tue Jun 7 12:28:16 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 13:28:16 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, DEBIEF Eric wrote: > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. Hi. This is helpful, thanks. I can think of 2 reasons I'm not collecting the data as fast as I think I should be: 1) the device to PC connection is not at 100% utilization 2) my SerialPortEventListener processing has too much overhead Are there other explanations I might be missing as to why it takes so long to transfer the data? Thanks. nall. From taj at www.linux.org.uk Tue Jun 7 13:21:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:21:46 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > On 6/7/05, DEBIEF Eric wrote: > > We are "pushing" RxTx /Java here in a half-duplex link. > > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > > and application handling) about 25?s/byte. > > The figures are the barely the same on two environments. > > Hi. > This is helpful, thanks. I can think of 2 reasons I'm not collecting > the data as fast as I think I should be: > 1) the device to PC connection is not at 100% utilization > 2) my SerialPortEventListener processing has too much overhead > > Are there other explanations I might be missing as to why it takes so > long to transfer the data? > Polling the port would probably make more sense. You can set the threshold/timeouts to avoid racing and not deal with the event notification. As mentioned earlier I think the event latency is ~10ms. Keep the event listener around, rxtx 2.* does not close well without it. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 13:27:27 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 14:27:27 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, Trent Jarvi wrote: > Polling the port would probably make more sense. You can set the > threshold/timeouts to avoid racing and not deal with the event > notification. As mentioned earlier I think the event latency is ~10ms. Trent, Thanks for the response. Just to make sure I understand what you're talking about, when you say event latency, do you mean the time it takes from when the byte hits the PC's comm port to when rxtx presents it to user code? So if the link is 100% utilized, will my user code see "hiccups" or a steady stream of data? Thanks for helping a serial port newbie. nall. From dacker at nomadio.net Tue Jun 7 13:32:20 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 15:32:20 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <20050607193118.5499329CAA0@mail.electronpusher.org> Some folks asked about the make file and ant steps. I have JAVA_HOME set as follows: $ echo $JAVA_HOME C:\Program Files\Java\jdk1.5.0_01 I have all the code in rxtx/src put into gnu/io . The make file here doesn't have optimizations turned on. We have not tested with it yet. --------------Begin Makefile------------------ CPPFLAGS="-I$(JAVA_HOME)/include" "-I$(JAVA_HOME)/include/win32" SOBJECTS=SerialImp.o fuserImp.o termios.o fixup.o init.o POBJECTS=ParallelImp.o termios.o init.o DLLS=rxtxParallel.dll rxtxSerial.dll all: $(CLASSES) $(DLLS) rxtxSerial.dll: $(SOBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(SOBJECTS) rxtxParallel.dll: $(POBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(POBJECTS) clean: rm -fv $(SOBJECTS) $(POBJECTS) $(DLLS) %.o: %.c gcc -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< %.o: %.cpp g++ -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< --------------End Makefile------------------ Here is the ant target I use to build the rxtx libs. Our build puts the class files in a bin dir. We copy the dlls to a deploy dir and to the build dir. Eclipse seems to like the dlls in the build dir. The deploy dir is used when we build our full package. --------------Begin Ant Section------------------ --------------End Ant Section------------------ > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > David S. Acker > Sent: Tuesday, June 07, 2005 2:08 PM > To: 'Java RXTX discussion' > Subject: [Rxtx] Patches to 2.1-7pre17 > > Hello, > I am using RxTx with the Nomadio Sensor, > http://www.nomadio.net/ . Our product includes a built in > USB to Serial adapter so that when it is connected to your PC > over USB, it appears as a serial port. We had problems with > Sun's comm library because it did not detect serial ports > coming and going properly. > > I did run into a few issues with RxTx though. I am building > under Windows (we support XP and 2000) under cygwin. I used > a simple make file for the c code that works under cygwin and > ant to build the java stuff. Attached is a diff file. The > patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h > for me. Also, gcc didn't like a local file (win32termios.h) > getting included with <> . > > RXTXPort.java - You can get an exception during the > writeByte, writeArray, nativeDrain, readByte, read, > readArray, readTerminatedArray, and nativeAvailable calls. > Without this patch the IOLocked count gets stuck incremented. > > termios.c - If you try to open a port through CreateFile and > get ERROR_ACCESS_DENIED it means someone else is using the > port. We need to make sure to use serial_close instead of > just close. I found that some devices finish their I/O > synchronously. The code was treating this as an error. I > also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we > must use quotes and not <> to include win32termios.h . I > also commented out a report call since it seems to happen > constantly on my system. > > Feel free to use these in any way that you want or just to > ignore them. > Thanks! > > -Dave Acker > dacker at nomadio.net > Software Engineer > Nomadio, Inc. > From taj at www.linux.org.uk Tue Jun 7 13:37:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:37:45 +0100 (BST) Subject: [Rxtx] Re: Stack Smashing Attack In-Reply-To: <200506072012.48860.ferdinand.tatzig@web.de> References: <200506072012.48860.ferdinand.tatzig@web.de> Message-ID: On Tue, 7 Jun 2005, Ferdinand Tatzig wrote: > Dear Trent > > I am using RXTX for serial port communication between a PC and a payment > transaction terminal. > When I run my application under Windows 2000, an i386-Linux or an i386-FreeBSD > it works as I expect it to do. However, when I start it to run on AMD64 > machine with a 64-bit Gentoo Linux, the VM terminates with the following > error: > > Port found: /dev/ttyS0 > java: stack smashing attack in function configure_port() > > I am using a 64-bit Blackdown-1.4.2-01 VM. > > I have searched the internet but have found no information about this error. > > This is the code of the method which initializes the serial port: > > /** > * initializes a serial port for communication with a terminal; only > * accessible within this class > * > * @param communication > * @param serialPortToBeInitialized > * @param tillInterfaceEventListener > */ > private TillInterfaceSerialPort(Communication communication, > String serialPortToBeInitialized, > TillInterfaceEventListener tillInterfaceEventListener) > throws IOException, PortInUseException, > TillInterfaceSerialPortNotFoundException, > TooManyListenersException, UnsupportedCommOperationException { > serialPortName = "not initialized yet"; > CommPortIdentifier portId = null; > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > boolean portFound = false; > String temporarySerialPortName = "not initialized yet"; > > // look for a serial port > while (portList.hasMoreElements() && !portFound) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > temporarySerialPortName = portId.getName(); > if (temporarySerialPortName.equals(serialPortToBeInitialized)) { > System.out.print("Port found: "); > System.out.println(temporarySerialPortName); > serialPortName = temporarySerialPortName; > portFound = true; > } > } > } > if (portFound) { > > // initialize the found port - this command causes the VM to terminate > serialPort = (SerialPort) portId > .open( > TillInterfaceConstants.APPLICATION_NAME, > TillInterfaceConstants > .TIMEOUT_IN_MILLISECONDS_FOR_OPENING_OF_COMMUNICATION_PORT); > > // add an event listener which listens > // on the serial port and notifies the > // serial port object when input bytes > // have been received at the port > serialPort.addEventListener(tillInterfaceEventListener); > serialPort.notifyOnDataAvailable(true); > > // initialize the physical layer > // parameters of the serial port > serialPort.setSerialPortParams(TillInterfaceConstants.BAUD_RATE, > SerialPort.DATABITS_8, SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > // set the inter-character > // timeout (T2) > serialPort > .enableReceiveTimeout(TillInterfaceConstants.INTERCHARACTER_TIMEOUT_IN_MILLISECONDS); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > } else > throw new TillInterfaceSerialPortNotFoundException(); > } > > Any hint to solve this problem would be kindly appreciated. > The only thing that comes to mind here after looking at the offending function is rxtx used to include asm/termios.h but now we moved to termios.h and had glibc fix their headers. The asm/termios.h caused problems as its termios was smaller than the actual termios. This should be fixed in current rxtx versions but you can just glance at SerialImp.c and make sure it does not include asm/termios.h. I've cc'd the rxtx mail list because there was one other mention of stack problems recently. I have used rxtx on opteron systems with success. I have a bug I'm trying hard to reproduce on suse 64 bit (circa linux 2.4.19) systems though. So far I have not been able to reproduce the bug. That said, with gentoo... I like gentoo but I seriously doubt they do any QA with their kernel and Java. I've seen problems before. If you use gentoo and have Java problems, at least stick to Linus (that is an s there) kernels while using Java. I'm not an expert on gentoo but I've seen patches go into experimental kernels that turn out to break java and are reverted before going to Linus just before I see problems with gentoo on this list. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:16:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:16:14 +0100 (BST) Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: On Tue, 7 Jun 2005, David S. Acker wrote: > Hello, > I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our > product includes a built in USB to Serial adapter so that when it is > connected to your PC over USB, it appears as a serial port. We had problems > with Sun's comm library because it did not detect serial ports coming and > going properly. > > I did run into a few issues with RxTx though. I am building under Windows > (we support XP and 2000) under cygwin. I used a simple make file for the c > code that works under cygwin and ant to build the java stuff. Attached is a > diff file. The patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h for me. Also, > gcc didn't like a local file (win32termios.h) getting included with <> . > > RXTXPort.java - You can get an exception during the writeByte, writeArray, > nativeDrain, readByte, read, readArray, readTerminatedArray, and > nativeAvailable calls. Without this patch the IOLocked count gets stuck > incremented. > > termios.c - If you try to open a port through CreateFile and get > ERROR_ACCESS_DENIED it means someone else is using the port. We need to > make sure to use serial_close instead of just close. I found that some > devices finish their I/O synchronously. The code was treating this as an > error. I also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we must use quotes > and not <> to include win32termios.h . I also commented out a report call > since it seems to happen constantly on my system. > > Feel free to use these in any way that you want or just to ignore them. > Thanks! > Hi Dave These patches look great as is. Thanks. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:33:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:33:16 +0100 (BST) Subject: [Rxtx] Patch to IOLocked (fwd) Message-ID: This appears to be another solution to the locking. Chris, the other option just moves the locking into the finally clause which I think would be a little cleaner though I'm posting this patch to so people can comment. -- Trent Jarvi tjarvi at qbang.org ---------- Forwarded message ---------- Date: Wed, 1 Jun 2005 13:01:32 +0100 From: Christopher Dawes To: taj at www.linux.org.uk Subject: Patch to IOLocked Do you want me to check it out of CVS and then submit changes? Christopher -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXPort.java.diff Type: application/octet-stream Size: 6965 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/c442f9fc/RXTXPort.java-0007.obj From Christopher.Dawes at retail-logic.com Wed Jun 8 00:57:24 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 8 Jun 2005 07:57:24 +0100 Subject: [Rxtx] Patch to IOLocked (fwd) [Virus Checked] In-Reply-To: Message-ID: Agreed, much better Java :-) Thanks Christopher ------------------------------------------- Consultant Engineer Retail Logic Limited Fleet GU51 3TZ Tel: +44 (0)1252 644377 Mob: +44 (0)7899 842759 Fax: +44 (0)1252 776708 rxtx-bounces at mail.electronpusher.org wrote on 07/06/2005 21:33:16: > > This appears to be another solution to the locking. Chris, the other > option just moves the locking into the finally clause which I think would > be a little cleaner though I'm posting this patch to so people can > comment. > > -- > Trent Jarvi > tjarvi at qbang.org > > ---------- Forwarded message ---------- > Date: Wed, 1 Jun 2005 13:01:32 +0100 > From: Christopher Dawes > To: taj at www.linux.org.uk > Subject: Patch to IOLocked > > Do you want me to check it out of CVS and then submit changes? > > Christopher[attachment "RXTXPort.java.diff" deleted by Chris > Dawes/Retaillogic/NISABA] _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx From zempftman at gmail.com Wed Jun 8 07:57:25 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 09:57:25 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Maxwell Zempftman Date: May 27, 2005 5:01 PM Subject: Re: [Rxtx] Kaffe & rxtx & armv5b To: rxtx at mail.linuxgrrls.org Here are the results from working this week: The "NullPointerExceptions" are generated by the software when I choose a bad device file. I discovered that this occurs on the i686-RedHat box as well. This exception seems to be generated only by this particular application, and not by the example programs in contrib. So, for example: java MyApp /dev/null <-- generates NullPointerException java MyApp fake <-- generates NullPointerException java MyApp /dev/ttyS0 <-- does not generate NullPointerException Using the program CommCheck (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it appears as though /dev/ttyS0 is the only valid serial device file on the XScale device, so the errors I was getting are not really be bugs. Although /dev/ttyS0 did not generate NullPointerExceptions, I did encounter this error: --start java MyApp /dev/ttyS0 (going mostly from memory, not exact) PortList.hasMoreElements: true Listening on: /dev/ttyS0 Client connected. >From net: echo kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 vmExcept_setJNIFrame Assert: on 'fp != 0' failed. --end I took a look at exception.h, and it seems as though the problematic code does not exist in newer versions of Kaffe (I have been using CVS-2004-11). Next week I will try to use a newer version, although so far everything but CVS-2004-11 has failed. Also, I the device files I need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with something like this? Thanks, Max. > On 5/21/05, Trent Jarvi wrote: > > I'm not sure what is wrong in the first part. It sounds like your > > application may be swallowing an exception while trying to enumerate the > > port or open it. The usual mistake made it not having permissions to > > either open the port or create the lockfile. There should be examples in > > the contrib directory you can try that enumerate and open ports. Maybe > > that will give you some hints. > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > Sun's code limiting you there though you do need to compile and install > > rxtx for the XScale with Sun's Commapi. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > From taj at www.linux.org.uk Wed Jun 8 08:22:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 15:22:44 +0100 (BST) Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > ---------- Forwarded message ---------- > From: Maxwell Zempftman > Date: May 27, 2005 5:01 PM > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > To: rxtx at mail.linuxgrrls.org > > > Here are the results from working this week: > > The "NullPointerExceptions" are generated by the software when I > choose a bad device file. I discovered that this occurs on the > i686-RedHat box as well. This exception seems to be generated only by > this particular application, and not by the example programs in > contrib. So, for example: > > java MyApp /dev/null <-- generates NullPointerException > java MyApp fake <-- generates NullPointerException > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > Using the program CommCheck > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > appears as though /dev/ttyS0 is the only valid serial device file on > the XScale device, so the errors I was getting are not really be bugs. > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > encounter this error: > > --start > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > PortList.hasMoreElements: true > Listening on: /dev/ttyS0 > Client connected. > >From net: echo > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > --end > > I took a look at exception.h, and it seems as though the problematic > code does not exist in newer versions of Kaffe (I have been using > CVS-2004-11). Next week I will try to use a newer version, although so > far everything but CVS-2004-11 has failed. Also, I the device files I > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > something like this? > In RXTXCommDriver, just look for the following code and add /dev/ttyM to the list. Moxa? if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } So: if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyM", // for Moxa ports "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } Linux just has way too many port types to try enumerating them all. There is potential we can add them back in with udev now. > Thanks, > Max. > > > On 5/21/05, Trent Jarvi wrote: > > > I'm not sure what is wrong in the first part. It sounds like your > > > application may be swallowing an exception while trying to enumerate the > > > port or open it. The usual mistake made it not having permissions to > > > either open the port or create the lockfile. There should be examples in > > > the contrib directory you can try that enumerate and open ports. Maybe > > > that will give you some hints. > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > Sun's code limiting you there though you do need to compile and install > > > rxtx for the XScale with Sun's Commapi. > > > > > > -- > > > Trent Jarvi > > > tjarvi at qbang.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Wed Jun 8 12:16:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 08 Jun 2005 13:16:03 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A60B8D.8080500@cs.umn.edu> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> Message-ID: <42A735E3.8040706@atcorp.com> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual serial comport. This isn't so much of a problem, what is, however, is that the comport does not appear to be able to be set to any arbitrary speed, only those from the data_rate enum. I've not found much on using different speeds, has anyone else encountered anything similar? I greatly appreciate any and all comments and suggestions. Thanks in advance, ~ Shawn Lavelle From zempftman at gmail.com Wed Jun 8 12:50:58 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 14:50:58 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: Thanks Trent! That will solve one of the problems. I don't know when my next chance to work on it will be, but I still need to figure out the error I got when I tried opening '/dev/ttyS0' on the Moxa device regarding a failed assertion, seemed to be a Kaffe issue. Thanks for you help, hope to have results soon, Max Englander. On 6/8/05, Trent Jarvi wrote: > On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > > > ---------- Forwarded message ---------- > > From: Maxwell Zempftman > > Date: May 27, 2005 5:01 PM > > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > > To: rxtx at mail.linuxgrrls.org > > > > > > Here are the results from working this week: > > > > The "NullPointerExceptions" are generated by the software when I > > choose a bad device file. I discovered that this occurs on the > > i686-RedHat box as well. This exception seems to be generated only by > > this particular application, and not by the example programs in > > contrib. So, for example: > > > > java MyApp /dev/null <-- generates NullPointerException > > java MyApp fake <-- generates NullPointerException > > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > > > Using the program CommCheck > > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > > appears as though /dev/ttyS0 is the only valid serial device file on > > the XScale device, so the errors I was getting are not really be bugs. > > > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > > encounter this error: > > > > --start > > > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > > > PortList.hasMoreElements: true > > Listening on: /dev/ttyS0 > > Client connected. > > >From net: echo > > > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > > > --end > > > > I took a look at exception.h, and it seems as though the problematic > > code does not exist in newer versions of Kaffe (I have been using > > CVS-2004-11). Next week I will try to use a newer version, although so > > far everything but CVS-2004-11 has failed. Also, I the device files I > > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > > something like this? > > > > > In RXTXCommDriver, just look for the following code and add /dev/ttyM to > the list. Moxa? > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > So: > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyM", // for Moxa ports > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > Linux just has way too many port types to try enumerating them all. There > is potential we can add them back in with udev now. > > > > > Thanks, > > Max. > > > > > On 5/21/05, Trent Jarvi wrote: > > > > I'm not sure what is wrong in the first part. It sounds like your > > > > application may be swallowing an exception while trying to enumerate the > > > > port or open it. The usual mistake made it not having permissions to > > > > either open the port or create the lockfile. There should be examples in > > > > the contrib directory you can try that enumerate and open ports. Maybe > > > > that will give you some hints. > > > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > > Sun's code limiting you there though you do need to compile and install > > > > rxtx for the XScale with Sun's Commapi. > > > > > > > > -- > > > > Trent Jarvi > > > > tjarvi at qbang.org > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- > Trent Jarvi > tjarvi at qbang.org > From taj at www.linux.org.uk Wed Jun 8 12:53:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 19:53:10 +0100 (BST) Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A735E3.8040706@atcorp.com> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: On Wed, 8 Jun 2005, Shawn Lavelle wrote: > Hello, > I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate > with a virtual serial comport. This isn't so much of a problem, what > is, however, is that the comport does not appear to be able to be set to > any arbitrary speed, only those from the data_rate enum. I've not found > much on using different speeds, has anyone else encountered anything > similar? I greatly appreciate any and all comments and suggestions. > This problem is a bit more tricky than it should be. POSIX systems just have a few specified baud rates. Solaris is one of these systems. CommAPI baud rates probably came from someone looking at Solaris. RXTX tries to be POSIX like. W32 is treated as a POSIX like system via a termios.c file in rxtx. Serial ports have baudbase and divisor. So you can set these to come close to the baudrate you want. Some funky equipment like automobile test equipment use baud rates that are not really possible with PC hardware. But if you get as close as possible by changing baud base and divisor, it works. Windows can actually do this for you. I don't know exactly what their code does but if you pass a baudrate to windows, it will guestimate a baudbase and divisor. So you just pass it 10200 baud and it does its job. This is not of very much use the way rxtx does things though. Linux has the standard POSIX like baud rates but if you set the baud rate to B38400, you can set your own baud base and divisor. This is not POSIX that I know of. W32 has more capability than POSIX like systems too. So I did some work to have windows work like Linux via termios.c But the code is not quit right. SerialImp.c and termios.c need some work so all the various buadrates work on Linux and W32. Most other systems will not work beyond what CommAPI already specifies without writting kernel drivers. This is on my todo list but if someone gets to it first, all the better. -- Trent Jarvi tjarvi at qbang.org From carobizar at free.fr Thu Jun 9 06:39:10 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Thu, 9 Jun 2005 14:39:10 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: <1118320750.42a8386e6d3ce@imp5-q.free.fr> Hi ! Thank you for all your advices. I managed to use rxtx on Windows but I have still some difficulties on Linux. I have yet follow your instructions and the configure file has created : - librxtxSerial.so and librxtxParallel.so in the directory /usr/java/j2sdk1.4.2_08/jre/lib/i386 - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the directory /usr/java/j2sdk1.4.2_08/jre/lib - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext But when I run my program, Some exceptions occur : Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver So, 1) What have I forgotten ? 2) Is it possible to make my application run on Linux without the jdk (only the jre) ? Best regards, Caroline. From taj at www.linux.org.uk Thu Jun 9 07:28:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 9 Jun 2005 14:28:05 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118320750.42a8386e6d3ce@imp5-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: On Thu, 9 Jun 2005 carobizar at free.fr wrote: > Hi ! > Thank you for all your advices. > I managed to use rxtx on Windows but I have still some difficulties on Linux. > I have yet follow your instructions and the configure file has created : > - librxtxSerial.so and librxtxParallel.so in the directory > /usr/java/j2sdk1.4.2_08/jre/lib/i386 > - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the > directory /usr/java/j2sdk1.4.2_08/jre/lib > - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext > > But when I run my program, Some exceptions occur : > Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while > loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > com.sun.comm.SolarisDriver > > So, > 1) What have I forgotten ? > The native (.so) libraries are not installed in a directory the JRE is looking for native libraries in. You may look around and see where the .so libraries are in the JRE. I don't know that the jre/lib/i386 directory is specified as a required directory for JREs. I noticed some do not use it. You may try printing the java.libarary.path to see your options. It is also possible to alter the java.library.path. > 2) Is it possible to make my application run on Linux without the jdk (only the > jre) ? Yes. Though installation from source with the JDK is less error prone. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0007.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 7 15:03:09 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 07 Jun 2005 16:03:09 -0500 Subject: [Rxtx] Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <42A60B8D.8080500@cs.umn.edu> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual comport. This isn't so much of a problem, what is, however, is that the comport is only ever set to 9600 baud. I've not found this as a documented bug, has anyone else encountered anything similar? I'll try and provide more detail tomorrow, but if anyone has any suggestions or encountered this before, I'd like to hear about it. Thanks in advance, ~ Shawn Lavelle From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0007.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0007.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0007.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Mon Jun 20 01:04:40 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 20 Jun 2005 08:04:40 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: <42B66A88.4060806@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050620/9be208a1/attachment-0007.html From fbalzarro at libero.it Mon Jun 20 02:33:52 2005 From: fbalzarro at libero.it (Fabio Balzarro) Date: Mon, 20 Jun 2005 10:33:52 +0200 Subject: [Rxtx] RXTXPort:close detected bad file descriptor Message-ID: I'm using RXTX libraries on IPAQ 4150 PDA with Windows CE 4.20 and Jeode. When I close a serial port with sp.close() (where sp is a SerialPort) sometimes an error occour 1119256168085: RXTXPort:close detected bad file descriptor What can I do? Thanks Fabio ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From slavelle at atcorp.com Mon Jun 20 08:08:19 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 20 Jun 2005 09:08:19 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: <42B6CDD3.4040409@atcorp.com> It turns out that I did have a driver-not-used issue which has now been resolved and I can use RxTx on it (had to add ttyUSB as a valid port), but only at standard baud rates. Does USB have the same restrictions on port speed as regular RS232? ~ Shawn Trent Jarvi wrote: > Just a note here. > > I have requested a FTDI usb device and they offered to send one for the > purpose of trying to get rxtx working. I have no idea how long that takes > though. > > > On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > > >>I'm afraid we're just using the latest version from the FTDI website. I've >>not yet played with linux properly with this and unfortunately I run gentoo >>and haven't yet successfully compiled in the ftdi driver. I'll let you know >>if I get any success. >> >>Appologies >> >>Christopher >> >>-----Original Message----- >>From: rxtx-bounces at mail.electronpusher.org >>[mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle >>Sent: 15 June 2005 00:00 >>To: Java RXTX discussion >>Subject: Re: [Rxtx] Virtual Com Ports >> >>Hmm, the latter sounds like a lot of work. It does find the virtual comport >>in windows, i must have just missed it earlier (sign of a long day). On the >>linux side, I suspect that something is not correct with the driver >>installation becuase it does not give me a tty for it :( >> >>Christopher, May I ask what driver you are using for your FTDI chip? >>Did you ever encounter problems with not getting a tty assigned for it? >> >> >> Thanks for all your help! >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>They will have to show up as a tty device in Linux. Probably ttyUSB? >>>That will need an entry in RXTXCommDriver.java. If they dont show up >>>as a tty device, rxtx cant treat it like a serial port. It just wont >> >>work. >> >>>With COM3, rxtx will try to open the port and perform a timed out read. >>>Usually if a port is not there, the read blows up or the open blows up. >>>Timing out is fine. COM3 used to share interrupts with COM1. I know >>>you can reassign ports in XP. RXTX scans up through COM255. You may >>>try moving it. >>> >>> >>>The code in question is the following in RXTXCommDriver.java >>> >>> >>> if(osName.equals("Linux")) >>> { >>> String[] Temp = { >>> "ttyS", // linux Serial Ports >>> "ttySA", // for the IPAQs >>> "ttyUSB" // for USB frobs >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>> else if(osName.toLowerCase().indexOf("windows") != -1 ) >>> { >>> String[] Temp = { >>> "COM" // win32 serial ports >>> //"//./COM" // win32 serial ports >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>>If COM3 can be read, it should be found. the ttyUSB should work if >>>thats in the version of RXTXCommDriver.java you have. >>> >>>If this is still a problem, it may be that the driver is erroring on >>>what may be considered normal comm port operations such as setting the >>>speed, timeout, threshold, .. One would have to start looking at each >>>function called in the native open() and read(). >>> >>> >>> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>>seems to find the device using rxtx. Looking at the hardware >>>>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>>>linux. I can't seem to get it to show up as a tty(s#) in linux which >>>>is probably just due to my lack of significant linux knowledge. >>>> >>>> ~ Shawn >>>> >>>>Trent Jarvi wrote: >>>> >>>> >>>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>Has anyone here noticed that virtual comports do not get enumerated >>>>>>via CommPortIdentifier.getPortIdentifiers()?? >>>>>> >>>>>>The device I'm trying to talk to uses an fdti usb to serial >>>>>>convertor with a driver that has it show up as a virtual comport. I >>>>>>can enter this port manually and it will be usable but I cannot get >>>>>>it show up automatically (as in the simple serial demo). Any thoughts >> >>on this? >> >>>>> >>>>>Hi Shawn, >>>>> >>>>>What OS is this and what is the name of the virtual port you are >>>>>trying to open? I suspect the name just needs to be added to >> >>RXTXCommDriver.java. >> >>>>_______________________________________________ >>>>Rxtx mailing list >>>>Rxtx at mail.electronpusher.org >>>>http://www.electronpusher.org/mailman/listinfo/rxtx >>>> >>> >>> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From lyon at docjava.com Mon Jun 20 15:06:08 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 20 Jun 2005 17:06:08 -0400 Subject: [Rxtx] testing Message-ID: Hi All, I am testing my new multi-platform Java Webstart RXTX application (Trent: I could not have done it without you!). So far, I think it will work under Linux (x86), Windows XP, Windows 2000 and MacOS X. The application is available as a Java webstart application at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Edit:Preferences: SerialPort Setup... should bring up a dialog box that enables dialing via the modem. Generally, it does not find internal modems (except on the mac). Why, I don't know. Thanks in advance for trying this new app. All feedback on it is welcome. - Doug Lyon From jasmine at electronpusher.org Tue Jun 21 04:15:53 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Tue, 21 Jun 2005 11:15:53 +0100 Subject: [Rxtx] testing In-Reply-To: References: Message-ID: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > Hi All, > I am testing my new multi-platform Java Webstart RXTX application > (Trent: I could not have done it without you!). > > So far, I think it will work under Linux (x86), Windows XP, > Windows 2000 and MacOS X. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. -J. From taj at www.linux.org.uk Tue Jun 21 05:50:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 12:50:23 +0100 (BST) Subject: [Rxtx] testing In-Reply-To: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> References: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> Message-ID: On Tue, 21 Jun 2005, Jasmine Strong wrote: > > On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > > > Hi All, > > I am testing my new multi-platform Java Webstart RXTX application > > (Trent: I could not have done it without you!). > > > > So far, I think it will work under Linux (x86), Windows XP, > > Windows 2000 and MacOS X. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > on my Mac. > passing -source 1.3 -target 1.3 to javac will compile classes without this problem. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 10:19:25 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 11:19:25 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. Sincerely, Jeremyah Payne From ricardo.trindade at emation.pt Tue Jun 21 13:25:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 20:25:00 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B8698C.2060509@emation.pt> Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > From taj at www.linux.org.uk Tue Jun 21 13:39:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:39:43 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <42B8698C.2060509@emation.pt> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> <42B8698C.2060509@emation.pt> Message-ID: It looks like he has an rs422 device/converter. This is not the problematic 'trying to do protocol X with a serial port' situation unless I'm missing something. I'll follow up with the other email I started. On Tue, 21 Jun 2005, Ricardo Trindade wrote: > Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. > > Payne, Jeremyah L (N-CIM) wrote: > > >Good morning, my name is Jeremyah and I am working on a java project to > >interface with some devices. In short, I have a laptop with a PCMIA > >converter that does RS422 running windows 2000. I also will be > >installing some PCI cards into some Linux boxes that will have probably > >4-8 RS422 ports on them. After doing some reading in order to talk > >with these items using my existing java code I will need an additional > >driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > >trying to get a map sort of where I need to make changes. As I see it, > >I would need to subclass SerialPort to my RS422 interface. That would > >link with a DLL or SO implementation that talks with the hardware. I > >also need to change the listing of working ports in the lookup section > >for serial. Does this seem like I am on the right track? Appreciate > >the support. > > > > > >Sincerely, > >Jeremyah Payne > >_______________________________________________ > >Rxtx mailing list > >Rxtx at mail.electronpusher.org > >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 21 13:40:25 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:40:25 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: On Tue, 21 Jun 2005, Payne, Jeremyah L (N-CIM) wrote: > Good morning, my name is Jeremyah and I am working on a java project to > interface with some devices. In short, I have a laptop with a PCMIA > converter that does RS422 running windows 2000. I also will be > installing some PCI cards into some Linux boxes that will have probably > 4-8 RS422 ports on them. After doing some reading in order to talk with > these items using my existing java code I will need an additional > driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > trying to get a map sort of where I need to make changes. As I see it, I > would need to subclass SerialPort to my RS422 interface. That would link > with a DLL or SO implementation that talks with the hardware. I also > need to change the listing of working ports in the lookup section for > serial. Does this seem like I am on the right track? Appreciate the > support. > Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 13:40:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 14:40:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618954@emss02m08.us.lmco.com> I'd like to except I am dealing with NASA. I am basically building a system to monitor 100+ Units that communicate over RS422. They have some converters in place but want to get rid of them. I'll check through the archives. I had started looking yesterday as was leaving work. -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Ricardo Trindade Sent: Tuesday, June 21, 2005 2:25 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From slavelle at atcorp.com Tue Jun 21 14:58:06 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 21 Jun 2005 15:58:06 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: <42B87F5E.4000403@atcorp.com> > Linux has the standard POSIX like baud rates but if you set the baud rate > to B38400, you can set your own baud base and divisor. This is not POSIX > that I know of. W32 has more capability than POSIX like systems too. So > I did some work to have windows work like Linux via termios.c > > But the code is not quit right. SerialImp.c and termios.c need some > work so all the various buadrates work on Linux and W32. Most other > systems will not work beyond what CommAPI already specifies without > writting kernel drivers. > > This is on my todo list but if someone gets to it first, all the better. Hmm, I guess I didn't read this close enough before. Just to be clear, the pieces to setBaudBase and setDivisor are not yet implemented, correct? Thanks, Shawn From sean_montgomery at baseview.com Tue Jun 21 15:14:08 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 21 Jun 2005 17:14:08 -0400 Subject: [Rxtx] OS X installation - file locations Message-ID: <8AB82C7F-0D19-45F9-AE54-A12C59A8495E@baseview.com> Greetings, I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) using the RXTX installation instructions. RXTX worked fine. Basically you've got: - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions - javax.comm.properties in /System/Library/Frameworks/ JavaVM.framework/Home/lib - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ lib/ext My coworker was concerned that the installation required files to be placed in /System/Library... because those directories are "Apple's" and subject to change at Apple's whim, and that it would be safer (less likely to break when a user updates their OS or Java version or what have you) if all the files could be somewhere in /Library... or / Library/Java. My coworker points out that when 3rd party apps like FrontBase and JBoss need to communicate with Java their jars are placed in /Library/Java/Extensions. Granted that RXTX 2.0 is implementing javax.comm and not just a 3rd party extension, might that be the case - that javax.* stuff needs to be in the Java system files? I'm not the Java maven that my coworker is, so I don't know if any of this is gospel or not. Any OS X/Java experts out there willing to comment? We'd like to be able to install RXTX in the safest, most maintenance free way possible, but if there are specific reasons why javax.comm.properties and comm.jar need to be in /System... then so be it. Any information is welcome, Sean From ricardo.trindade at emation.pt Tue Jun 21 15:56:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 22:56:53 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B88D25.7060604@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050621/f6c9f5fe/attachment-0007.html From jeremyah.l.payne at lmco.com Tue Jun 21 15:22:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 16:22:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618955@emss02m08.us.lmco.com> -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Trent Jarvi Sent: Tuesday, June 21, 2005 2:40 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 As of yet we have not decided on the PCI boards to use yet So I am still waiting to se how we will interface to them. But the laptop is ready to use so ill build a test app for that API for now. The overview of class structure is really what I needed. I guess I will use the 2.1 as you suggested. Thanks for the help thus far! BTW, you guys wouldn't happen to keep class diagrams or anything of that nature around would you? If not I will probably end up having to do some anyway for documentation purposes, I could include them. Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From dmarkman at mac.com Tue Jun 21 18:13:28 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 21 Jun 2005 20:13:28 -0400 Subject: [Rxtx] OS X installation - file locations In-Reply-To: References: Message-ID: <044F520C-585C-4B99-82ED-3BA83DB8CE77@mac.com> Apple doesn't recommend to put jars into the /System/Library/Frameworks/JavaVM.framework/Home/lib/ext folder from other hands it's standard java directory to put extentions if you want to support comm api on whole system then I'd recommend to put jars into the /Library/Java/Extensions folder just like you did if you want to support comm api per user put your jars into the ~/ Library/Java/Extensions On Jun 21, 2005, at 5:14 PM, Java RXTX discussion wrote: > Greetings, > > > I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) > using the RXTX installation instructions. RXTX worked fine. > > > Basically you've got: > - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions > - javax.comm.properties in /System/Library/Frameworks/ > JavaVM.framework/Home/lib > - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ > lib/ext > > > My coworker was concerned that the installation required files to be > placed in /System/Library... because those directories are "Apple's" > and subject to change at Apple's whim, and that it would be safer > (less likely to break when a user updates their OS or Java version or > what have you) if all the files could be somewhere in /Library... or / > Library/Java. My coworker points out that when 3rd party apps like > FrontBase and JBoss need to communicate with Java their jars are > placed in /Library/Java/Extensions. Granted that RXTX 2.0 is > implementing javax.comm and not just a 3rd party extension, might > that be the case - that javax.* stuff needs to be in the Java system > files? > > > I'm not the Java maven that my coworker is, so I don't know if any of > this is gospel or not. Any OS X/Java experts out there willing to > comment? We'd like to be able to install RXTX in the safest, most > maintenance free way possible, but if there are specific reasons why > javax.comm.properties and comm.jar need to be in /System... then so > be it. > > > Any information is welcome, > > > Sean > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Dmitry Markman Dmitry Markman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050622/beea65d0/attachment-0007.html From lyon at docjava.com Thu Jun 23 04:39:47 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 23 Jun 2005 06:39:47 -0400 Subject: [Rxtx] web start + RXTX = strange errors? Message-ID: On: Date: Tue, 21 Jun 2005 11:15:53 +0100 From: Jasmine Strong Writes: An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. ----------- I cannot duplicate your error. My version of Java is: java -version java version "1.4.2_05" Is yours the same? Trent: You wrote: passing -source 1.3 -target 1.3 to javac will compile classes without this problem. ----------- OK, I have updated the disto to work with jdk1.3: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Jasmine: Is this working any better? Thanks! - DL From handzisk at tkn.tu-berlin.de Fri Jun 24 02:37:14 2005 From: handzisk at tkn.tu-berlin.de (Vlado Handziski) Date: Fri, 24 Jun 2005 10:37:14 +0200 (CEST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace Message-ID: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Hi all, let me first express my compliments on the great work you have done with the RXTX library. We have been using the library for some time, and we are at a point where we want to make our code public. For legacy reasons, the code that the RXTX library is bundled with, uses the javax.comm namespace. We have been using the ChangePackage script to change the RXTX2.1 package from gnu.io into javax.comm. We need the independent implementation since we want to be able to directly access /dev/ttyUSBx ports in linux and the CommAPI versions are just not as stable. On the download page, there is a comment that this is in violation of sun's license. Can someone shed more light on this. I was not aware that you can protect the names of the java packages. Best regards, Vlado From ricardo.trindade at emation.pt Fri Jun 24 04:01:17 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 11:01:17 +0100 Subject: [Rxtx] parity missed Message-ID: <42BBD9ED.3060004@emation.pt> Hi, I have a "parity missed error". From previous posts I believe this has to do with CMSPAR not being defined. I checked out 2.1 head from CVS. How can I make sure I do a proper build and CMSPAR is defined ? Perhaps it would be good to have a release snapshot that has this, I think the latest snapshot (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. Another question I have, is why must this depend on kernel headers, why can't it be defined in the RXTX source ? thanks Ricardo From jasmine at electronpusher.org Fri Jun 24 04:09:06 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 24 Jun 2005 11:09:06 +0100 Subject: [Rxtx] web start + RXTX = strange errors? In-Reply-To: References: Message-ID: <644aad2bdbba950f0a2fb12d7dcfd8a6@electronpusher.org> On 23 Jun 2005, at 11:39, Dr. Douglas Lyon wrote: > OK, I have updated the disto to work with jdk1.3: > http://show.docjava.com:8086/book/cgij/code/jnlp/ > addbk.JAddressBook.Main.jnlp > > Jasmine: Is this working any better? Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) -J. From taj at www.linux.org.uk Fri Jun 24 10:54:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 17:54:12 +0100 (BST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: On Fri, 24 Jun 2005, Vlado Handziski wrote: > Hi all, > > let me first express my compliments on the great work you have done with > the RXTX library. > > We have been using the library for some time, and we are at a point where > we want to make our code public. For legacy reasons, the code that the > RXTX library is bundled with, uses the javax.comm namespace. We have been > using the ChangePackage script to change the RXTX2.1 package from gnu.io > into javax.comm. We need the independent implementation since we want to > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > versions are just not as stable. > > On the download page, there is a comment that this is in violation of > sun's license. Can someone shed more light on this. I was not aware that > you can protect the names of the java packages. > > Best regards, > Vlado > I can't provide legal advice as I am not a lawyer. (v) may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are contained in the "java", "javax" or "sun" packages or similar as specified by Sun in any class file naming convention; and The license is in the commapi package from Sun. The above is also in all the EULA's you click through to download from Sun if I'm not mistaken. Simply put, the license taints developers that agree to it. For those developers, Sun has control of the javax.comm namespace. It really does not make sense to put rxtx 2.1 in the javax.comm namespace. It will only cause confusion which I think is the point of the clause above. The gnu.io namespace was perhaps a poor choice and just tossed in when reviewing the license to get out of Sun's namespace. There is nothing in the rxtx license limiting your freedom in this fashion though. Many companies are moving to gnu.io and some distribute it with popular applications you would recognize. I'm tempted to ask you not to contaminate rxtx 2.1 with the javax.comm namespace. You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) extensions to existing classes (which I dont think you are using); it is not just javax.comm. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 24 13:24:09 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 20:24:09 +0100 (BST) Subject: [Rxtx] parity missed In-Reply-To: <42BBD9ED.3060004@emation.pt> References: <42BBD9ED.3060004@emation.pt> Message-ID: On Fri, 24 Jun 2005, Ricardo Trindade wrote: > Hi, > > I have a "parity missed error". From previous posts I believe this > has to do with CMSPAR not being defined. > I checked out 2.1 head from CVS. How can I make sure I do a proper > build and CMSPAR is defined ? Perhaps it would be good to have a release > snapshot that has this, I think the latest snapshot > (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. > > Another question I have, is why must this depend on kernel headers, > why can't it be defined in the RXTX source ? > I used to cheat and grab the CMSPAR from the kernel headers because glibc did not have it. Now rxtx uses the glibc headers and we have a patch in glibc I trust that handles this. It would not be right to override glibc and it wasnt right to use the kernel headers (it really did cause problems). You can override glibc for now with the following in the top of SerialImp.c # define CMSPAR 010000000000 You can check if your distro headers have this right bit looking for the above in bits/termios.h. It should look like this: #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif If it is not defined, please file a bug with your distro as rxtx is not the only thing that will be broken on that distro. I was going to release new cvs snapshots last weekend but got tied up. I'll do it this weekend. I also need to get custom baudrate patches into the cvs snapshot. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Fri Jun 24 13:56:50 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 20:56:50 +0100 Subject: [Rxtx] parity missed In-Reply-To: References: <42BBD9ED.3060004@emation.pt> Message-ID: <42BC6582.2070805@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050624/e3b39631/attachment-0007.html From vlado.handziski at gmail.com Sat Jun 25 06:25:52 2005 From: vlado.handziski at gmail.com (Vlado Handziski) Date: Sat, 25 Jun 2005 14:25:52 +0200 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: <697986ec05062505256ebf381f@mail.gmail.com> Thanks for the clarification. Since changing the bundled source is not an option at this moment, we will consider using javax.comm and RXTX2.0. In the next rewrite, we would probably move to gnu.io . Best regards, Vlado Handziski On 6/24/05, Trent Jarvi wrote: > > On Fri, 24 Jun 2005, Vlado Handziski wrote: > > > Hi all, > > > > let me first express my compliments on the great work you have done with > > the RXTX library. > > > > We have been using the library for some time, and we are at a point > where > > we want to make our code public. For legacy reasons, the code that the > > RXTX library is bundled with, uses the javax.comm namespace. We have > been > > using the ChangePackage script to change the RXTX2.1 package from gnu.io > > into javax.comm. We need the independent implementation since we want to > > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > > versions are just not as stable. > > > > On the download page, there is a comment that this is in violation of > > sun's license. Can someone shed more light on this. I was not aware that > > you can protect the names of the java packages. > > > > Best regards, > > Vlado > > > > I can't provide legal advice as I am not a lawyer. > > (v) may not create, or authorize your licensees to create additional > classes, interfaces, or subpackages that are contained in the "java", > "javax" or "sun" packages or similar as specified by Sun in any class file > naming convention; and > > The license is in the commapi package from Sun. The above is also in all > the EULA's you click through to download from Sun if I'm not mistaken. > > Simply put, the license taints developers that agree to it. For those > developers, Sun has control of the javax.comm namespace. > > It really does not make sense to put rxtx 2.1 in the javax.comm namespace. > It will only cause confusion which I think is the point of the clause > above. The gnu.io namespace was perhaps a poor choice and > just tossed in > when reviewing the license to get out of Sun's namespace. > > There is nothing in the rxtx license limiting your freedom in this fashion > though. Many companies are moving to gnu.io and some > distribute it with > popular applications you would recognize. I'm tempted to ask you not > to contaminate rxtx 2.1 with the javax.comm namespace. > > You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm > using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) > extensions to existing classes (which I dont think you are using); it is > not just javax.comm. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050625/1dadc50e/attachment-0007.html From taj at www.linux.org.uk Sun Jun 26 11:34:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 26 Jun 2005 18:34:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. Message-ID: The attached file should fix baud_base and divisor extensions for Linux The patch is against rxtx 2.1 CVS HEAD. To use this patch, you should set the baud rate to 38400. You can then try SerialPort.setBaudBase(int) and SerialPort.setDivisor(int) There are matching int SerialPort.getBaudBase() and int SerialPort.getDivisor(). What baud bases are available depends upon the serial port card and its driver so this is a bit of a blind attempt on my part. I've looked at the w32 API and I dont see anything available yet. The w32 code in RXTX will probably be figuring out the baud rate based on the tried baud base and divisor and just slamming it at the API for now (the API does something with that but I've not found real documentation on what it does). I dont want to try tinkering with the UART directly yet as that would involve poking machine memory directly and could very easily be error prone in bad ways. I don't expect Solaris or any SysV UNIX systems to work at all with this - ever. It is not standard in any way and will throw Exceptions on everything but Linux (w32 will just fail miserably as it is 1/2 implemented). If anyone has looked at custom baud rates before and has some thoughts or just wants to try the attached untested patch, I'd appreciate any feedback. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- ? autom4te.cache ? build ? output cvs server: Diffing . Index: configure =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure,v retrieving revision 1.35.2.59 diff -u -r1.35.2.59 configure --- configure 16 Oct 2004 16:20:34 -0000 1.35.2.59 +++ configure 26 Jun 2005 16:59:28 -0000 @@ -9644,6 +9644,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { #if defined (__GLIBC__) @@ -9782,6 +9784,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { @@ -9825,7 +9829,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -9837,7 +9841,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 26 Jun 2005 16:59:28 -0000 @@ -218,6 +218,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { #if defined (__GLIBC__) @@ -356,6 +358,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { @@ -399,7 +403,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -411,7 +415,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" cvs server: Diffing CNI cvs server: Diffing MACOSX_IDE cvs server: Diffing MACOSX_IDE/CW cvs server: Diffing MACOSX_IDE/ForPackageMaker cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions cvs server: Diffing MACOSX_IDE/ForPackageMaker/Resources cvs server: Diffing MACOSX_IDE/PB cvs server: Diffing WinCE cvs server: Diffing contrib cvs server: Diffing debian cvs server: Diffing src Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 26 Jun 2005 16:59:29 -0000 @@ -2079,15 +2079,17 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int BaudBase The clock frequency divided by 16. Default * BaudBase is 115200. * @return boolean true on success - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:setBaudBase()"); @@ -2097,10 +2099,11 @@ /** * Extension to CommAPI * @return int BaudBase - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getBaudBase() throws UnsupportedCommOperationException + public int getBaudBase() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getBaudBase()"); @@ -2108,13 +2111,14 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, IOException { if ( debug ) z.reportln( "RXTXPort:setDivisor()"); @@ -2124,10 +2128,11 @@ /** * Extension to CommAPI * @returns int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getDivisor() throws UnsupportedCommOperationException + public int getDivisor() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getDivisor()"); Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 26 Jun 2005 16:59:30 -0000 @@ -1877,16 +1877,27 @@ int fd = get_java_var( env, jobj,"fd","I" ); struct serial_struct sstruct; + if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) + { + goto fail; + } + + sstruct.baud_base = (int) BaudBase; + if ( sstruct.baud_base < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetBaudBase", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetBaudBase", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1914,9 +1925,13 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) ( sstruct.baud_base ) ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetBaudBase", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetBaudBase", strerror( errno ) ); @@ -1950,19 +1965,23 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } if ( sstruct.custom_divisor < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetDivisor", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetDivisor", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1971,7 +1990,7 @@ accept: none perform: Find the Divisor used for custom speeds - return: Divisor + return: Divisor negative value on error. exceptions: Unsupported Comm Operation on systems not supporting TIOCGSERIAL comments: @@ -1990,10 +2009,14 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) sstruct.custom_divisor ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetDivisor", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetDivisor", strerror( errno ) ); @@ -2032,7 +2055,7 @@ /* Open and lock the port so nothing else changes the setting */ - if ( LOCK( filename, pid ) ) goto fail;; + if ( LOCK( filename, pid ) ) goto fail; fd = find_preopened_ports( filename ); if( !fd ) Index: src/SerialPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/Attic/SerialPort.java,v retrieving revision 1.3.2.9 diff -u -r1.3.2.9 SerialPort.java --- src/SerialPort.java 12 Oct 2004 08:59:28 -0000 1.3.2.9 +++ src/SerialPort.java 26 Jun 2005 16:59:30 -0000 @@ -103,13 +103,17 @@ public abstract String getUARTType() throws UnsupportedCommOperationException; public abstract boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getBaudBase() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getDivisor() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setLowLatency() throws UnsupportedCommOperationException; public abstract boolean getLowLatency() cvs server: Diffing src/lfd cvs server: Diffing src/psmisc From uwe at kubosch.no Mon Jun 27 14:13:57 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Mon, 27 Jun 2005 22:13:57 +0200 Subject: [Rxtx] RXTX on FC4 Message-ID: <1119903238.2989.27.camel@BPC0276> Hi all! I just got RXTX to work on Fedora Core 4. The standard download did not work. I had to check the code out from CVS and build it, but then it worked flawlessly. Thanks for your good work. Now I wonder if I should contribute the compiled files so that others will have an easier time than me getting RXTX to work on FC4. What do I do? Who do I talk to? donV From taj at www.linux.org.uk Mon Jun 27 14:29:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 27 Jun 2005 21:29:46 +0100 (BST) Subject: [Rxtx] RXTX on FC4 In-Reply-To: <1119903238.2989.27.camel@BPC0276> References: <1119903238.2989.27.camel@BPC0276> Message-ID: On Mon, 27 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I just got RXTX to work on Fedora Core 4. > > The standard download did not work. > > I had to check the code out from CVS and build it, but then it worked > flawlessly. > > Thanks for your good work. > > Now I wonder if I should contribute the compiled files so that others > will have an easier time than me getting RXTX to work on FC4. What do I > do? Who do I talk to? > > The best thing to do with FC is to contibute an extras RPM. Debian does something like this with their .deb packaging. As rxtx is OS neutral, it is almost impossible to have everything on rxtx.org. If you do get a package in Fedora Extras, I can point a link there. The extra's mail list is here: https://www.redhat.com/mailman/listinfo/fedora-extras-list If it would help to have me release a 'stable' .tar.gz of the source for the RPM submittal process I can do that. It would also trigger upgrades in debian which would not be bad. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Mon Jun 27 16:23:20 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 27 Jun 2005 17:23:20 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: Message-ID: <42C07C58.1030608@atcorp.com> Hey Trent, I installed it and now I get IOExceptions instead of the other one. I'm not sure how those changes would have enabled setDivisor and setBaudBase to work though. Is it significant that this is a USB device emulating a serial port? ~ Shawn From taj at www.linux.org.uk Mon Jun 27 18:07:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 01:07:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: <42C07C58.1030608@atcorp.com> References: <42C07C58.1030608@atcorp.com> Message-ID: On Mon, 27 Jun 2005, Shawn Lavelle wrote: > Hey Trent, > I installed it and now I get IOExceptions instead of the other one. > I'm not sure how those changes would have enabled setDivisor and > setBaudBase to work though. Is it significant that this is a USB device > emulating a serial port? > The USB driver probably does not support this. With USB, the ioctl()'s appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through the linux drivers/usb tree and found to ioctl to support this in Linux 2.6.10. RXTX is not doing very much magic, the patch really only gets the serial struct instead of writing a structure with random values for baudbase and handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel level driver issue not a user space library issue. So if you wanted this to work, the usb serial driver would have to handle the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression after looking through the USB tree quickly. I hope that helps. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Jun 27 18:25:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 27 Jun 2005 20:25:22 -0400 Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) Message-ID: Hi All, I wrote: Jasmine: Is this working any better? And Jasmine says: Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) I am using -source 1.3 and -target 1.3 for the compilation, however, we still seem to have this problem, which my machine (for some reason) does not have. Does anyone have any ideas about what might be the problem? Thanks! - DL From taj at www.linux.org.uk Mon Jun 27 19:04:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 02:04:37 +0100 (BST) Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) In-Reply-To: References: Message-ID: On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I wrote: > Jasmine: Is this working any better? > > And Jasmine says: > Nope. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > > I am using -source 1.3 and -target 1.3 > for the compilation, however, we still seem to have this problem, > which my machine (for some reason) does not have. > Does anyone have any ideas about what might be the problem? > This has shown up in the past with jdk 1.5 compiled jars running on jre 1.4 machines. My guess is either jasmine has an old copy of rxtx with the problem on her machine that is being picked up on the classpath or you have not tried this with jre 1.4. The suggested -source/target fix should avoid the problem. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Mon Jun 27 21:23:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 04:23:55 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: On Tue, 28 Jun 2005, Trent Jarvi wrote: > On Mon, 27 Jun 2005, Shawn Lavelle wrote: > > > Hey Trent, > > I installed it and now I get IOExceptions instead of the other one. > > I'm not sure how those changes would have enabled setDivisor and > > setBaudBase to work though. Is it significant that this is a USB device > > emulating a serial port? > > > > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > > RXTX is not doing very much magic, the patch really only gets the serial > struct instead of writing a structure with random values for baudbase and > handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel > level driver issue not a user space library issue. > > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. > > I hope that helps. > > > It may be possible that you can just modify translate_speed and get_java_baudrate in SerialImp.c to have the new high speds you are after. The defines are in /usr/include/termios.h. #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 You can see many of these are not handled. I dont think CommAPI handled more than 57600 or so. int get_java_baudrate( int native_speed ) { switch( native_speed ) { case B0: return 0; case B50: return 50; case B75: return 75; case B110: return 110; case B134: return 134; case B150: return 150; case B200: return 200; case B300: return 300; case B600: return 600; case B1200: return 1200; case B1800: return 1800; case B2400: return 2400; case B4800: return 4800; case B9600: return 9600; case B19200: return 19200; case B38400: return 38400; case B57600: return 57600; default: return -1; } } int translate_speed( JNIEnv *env, jint speed ) { LEAVE( "RXTXPort:translate_speed" ); switch( speed ) { case 0: return B0; case 50: return B50; case 75: return B75; case 110: return B110; case 134: return B134; case 150: return B150; case 200: return B200; case 300: return B300; case 600: return B600; case 1200: return B1200; case 1800: return B1800; case 2400: return B2400; case 4800: return B4800; case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; #ifdef B57600 case 57600: return B57600; #endif /* B57600 */ #ifdef B115200 case 115200: return B115200; #endif /* B115200 */ #ifdef B230400 case 230400: return B230400; #endif /* B230400 */ #ifdef B460800 case 460800: return B460800; #endif /* B460800 */ #ifdef B14400 case 14400: return B14400; #endif /* B14400 */ #ifdef B28800 case 28800: return B28800; #endif /* B28800 */ #ifdef B128000 /* dima */ case 128000: return B128000; #endif /* dima */ #ifdef B256000 /* dima */ case 256000: return B256000; #endif /* dima */ } /* Handle custom speeds */ if( speed >= 0 ) return speed; else { LEAVE( "RXTXPort:translate_speed: Error condition" ); return -1; } } -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 28 05:20:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 28 Jun 2005 07:20:21 -0400 Subject: [Rxtx] cross-compilation using Make for Mac Message-ID: Hi All, Please excuse the long post; Trent said: >" >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. " Here is what I have on the mac version: java -version java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) When I run: http://show.docjava.com:8086/book/cgij/code/jnlp/math.benchmarks.Dhry.jnlp I get: -- listing properties -- jnlpx.heapsize=NULL,NULL jnlpx.splashport=-1 java.runtime.name=Java(TM) 2 Runtime Environment, Stand... java.protocol.handler.pkgs=com.sun.javaws.net.protocol sun.boot.library.path=/System/Library/Frameworks/JavaVM.fra... java.vm.version=1.4.2-38 awt.nativeDoubleBuffering=true gopherProxySet=false http.auth.serializeRequests=true java.vm.vendor="Apple Computer, Inc." java.vendor.url=http://apple.com/ path.separator=: java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io jnlpx.home=/Applications/Utilities/Java/Java Web... user.country=US sun.os.patch.level=unknown java.vm.specification.name=Java Virtual Machine Specification user.dir=/ java.runtime.version=1.4.2_05-141.4 java.awt.graphicsenv=apple.awt.CGraphicsEnvironment java.endorsed.dirs=/System/Library/Frameworks/JavaVM.fra... os.arch=ppc java.io.tmpdir=/tmp line.separator= java.vm.specification.vendor=Sun Microsystems Inc. jnlpx.remove=false os.name=Mac OS X sun.java2d.fontpath= java.library.path=/Applications/Utilities/Java/Java Web... java.specification.name=Java Platform API Specification java.class.version=48.0 jnlpx.deployment.user.home=/Users/lyon/Library/Caches/Java Web S... java.util.prefs.PreferencesFactory=java.util.prefs.MacOSXPreferencesFactory os.version=10.3.9 user.home=/Users/lyon user.timezone=America/New_York java.security.policy=file:/Applications/Utilities/Java/Jav... java.awt.printerjob=apple.awt.CPrinterJob trustProxy=true java.specification.version=1.4 file.encoding=MacRoman jnlpx.deployment.system.home=/Applications/Utilities/Java/J2SE 5.0... user.name=lyon java.class.path=/Applications/Utilities/Java/Java Web... java.vm.specification.version=1.0 sun.arch.data.model=32 java.home=/System/Library/Frameworks/JavaVM.fra... java.specification.vendor=Sun Microsystems Inc. user.language=en awt.toolkit=apple.awt.CToolkit java.vm.info=mixed mode java.version=1.4.2_05 java.ext.dirs=/Users/lyon/Library/Java/Extensions:/... sun.boot.class.path=/System/Library/Frameworks/JavaVM.fra... java.vendor=Apple Computer, Inc. file.separator=/ java.vendor.url.bug=http://developer.apple.com/java/ sun.cpu.endian=big sun.io.unicode.encoding=UnicodeBig mrj.version=141.3 jnlpx.jvm=/System/Library/Frameworks/JavaVM.fra... sun.cpu.isalist= sun.awt.exception.handler=apple.awt.CToolkit$EventQueueExceptio... javawebstart.version=javaws-1.4.2_05 800 mhz g4,878k ds/sec total time: 1184ms Result: 844594 dhrystone/sec. Load average for last 15 minutes:0.62 So, I feel pretty sure that I have tried this with 1.4. As to modifying the RXTX compilation, that I did not do...and I take your point. I have been using the binary distributions as is. Oops. I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Now when I do a make, I get: make gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known libtool: link: warning: undefined symbols not allowed in i386-pc-mingw32 shared libraries rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ln: `SerialImp.o': File exists make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 So, I do a make clean, then a make: .... (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ar cru .libs/librxtxSerial.a /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o ar: /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o: No such file or directory make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 In the i386 directory, there is a symbolic link left from something: ls -al SerialImp.o lrwxrwxrwx 1 lyon lyon 12 Jun 28 07:03 SerialImp.o -> SerialImp.lo However, the SerialImp.lo is not present (which is the cause of the error, I think). On the other hand, the file I am looking for is present in: i686-pc-linux-gnu Possibly the i386 generation is not clean (of course it is also likely that I am just asking dumb questions, being a newbie to the code and all.). Finally, will this make file regenerate the distro for the mac? I found some really old (from year 2001) files in: cvs/MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions Which I could use for the distro...but I would prefer to do a clean, multi-platform build from make. Thanks! - Doug >On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > >> Hi All, >> I wrote: >> Jasmine: Is this working any better? >> >> And Jasmine says: >> Nope. >> >> An error occurred while launching/running the application. >> >> Title: addbk.JAddressBook.Main >> Vendor: DocJava, Inc. >> Category: Unexpected Error >> >> gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) >> >> > > I am using -source 1.3 and -target 1.3 >> for the compilation, however, we still seem to have this problem, >> which my machine (for some reason) does not have. >> Does anyone have any ideas about what might be the problem? >> > >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. > > >The suggested -source/target fix should avoid the problem. > >-- >Trent Jarvi >tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 28 09:43:41 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 28 Jun 2005 10:43:41 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: <42C1702D.1070307@atcorp.com> > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. There is ioctl stuff in the driver for the chip, but i haven't seen the TIOC*SERIAL entries. That might be why it continues to fail. I did get around the problem, though, by hacking the driver and just specifying the baud rate I need. Now everything works well. Thanks for all the assistance you've provided. ~ Shawn M. Lavelle From taj at www.linux.org.uk Tue Jun 28 12:42:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:42:29 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known Add a compiler flag -DWIN32 The code above should not be compiling on w32 as it is #if !defined(WIN32) You can look at the bottom of Makefile.in to see the w32 compile flags. Search for "WIN32 CrossCompiling from here down" If its still not working, I can set you up with the Bob account. Just email me off the list. W32 compiling is a bit complicated. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 28 12:52:50 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:52:50 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Nods. I did change configure but right now it is only in the baudbase/divisor patch I posted. I'm going to add several extension baud rates that can be supported by normal API calls and commit that today as a followup to my comments yesterday on baudrates. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Wed Jun 29 01:52:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 08:52:10 +0100 (BST) Subject: [Rxtx] [PATCH] More baud rate fixes Message-ID: I went through the native baudrate conversion from Java and added several. This patch is against CVS 2.1 head. I think thats it for baud rate fixes unless someone see something. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- A non-text attachment was scrubbed... Name: baud_base_and_divisor_plus_odd_baudrates.diff.gz Type: application/x-gzip Size: 3291 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050629/4c1ef1c2/baud_base_and_divisor_plus_odd_baudrates.diff-0007.gz From lyon at docjava.com Wed Jun 29 10:33:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 29 Jun 2005 12:33:45 -0400 Subject: [Rxtx] java.comm dependencies Message-ID: Hi All, During a build of the rxtx code, I have left the javax.comm out of the system (on purpose). However, I get an error, at run time: CommPortIdentifier:static initialization() apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: javax/comm/CommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver I am thinking that there is something in the gnu.io.CommPortIdentifier that seeks to load the javax.comm.CommDriver. It was my understanding that we could write code without reference to the javax.comm.CommDriver and that we could work in the gnu namespace. Is this true? Thanks! - Doug From taj at www.linux.org.uk Wed Jun 29 11:16:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 18:16:08 +0100 (BST) Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > During a build of the rxtx code, I have left the > javax.comm out of the system (on purpose). > However, I get an error, at run time: > > CommPortIdentifier:static initialization() > apple.awt.EventQueueExceptionHandler Caught Throwable : > java.lang.NoClassDefFoundError: javax/comm/CommDriver > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > that seeks to load the javax.comm.CommDriver. > > It was my understanding that we could write code without reference > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > Is this true? > Yes. People use 2.1 without javax all the time. There should be no reference to javax at all in rxtx 2.1. You may check your code. I just did a grep through 2.1 and there is nothing. You may look at the classes you are using. If you find javax.comm in your code, replace it with gnu.io and that should be all you need to do. -- Trent Jarvi tjarvi at qbang.org From jayant28k at gmail.com Wed Jun 29 21:49:28 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Thu, 30 Jun 2005 09:19:28 +0530 Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: <6a6a02310506292049778c452f@mail.gmail.com> Trent, I think best idea is to have wiki for rxtx code. So as the traffic is increasing with time. "RXTX" seems to be more popular in embbeded system. Sun Microsystems will always apperciate your efforts on parallel and serial ports commincation based application in IT Industry. Thanks for your help on this forum as "ONE MAN ARMY" ;-) Cheers, Jayant On 6/29/05, Trent Jarvi wrote: > On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > > > Hi All, > > During a build of the rxtx code, I have left the > > javax.comm out of the system (on purpose). > > However, I get an error, at run time: > > > > CommPortIdentifier:static initialization() > > apple.awt.EventQueueExceptionHandler Caught Throwable : > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > > that seeks to load the javax.comm.CommDriver. > > > > It was my understanding that we could write code without reference > > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > > > Is this true? > > > > Yes. People use 2.1 without javax all the time. > > There should be no reference to javax at all in rxtx 2.1. You may check > your code. I just did a grep through 2.1 and there is nothing. You may > look at the classes you are using. > > If you find javax.comm in your code, replace it with gnu.io and that > should be all you need to do. > > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From uwe at kubosch.no Sat Jun 25 02:50:24 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Sat, 25 Jun 2005 10:50:24 +0200 Subject: [Rxtx] RXTX in FC3/FC4 Message-ID: <1119689424.12606.14.camel@BPC0276> Hi all! I am trying to get RXTX to work on Fedora Core, version 3 or 4. I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext directory. I have edited the jre/lib/javax.comm.properties according to the docs. I have tried this with both rxtx 2.0 and 2.1. I have tried on two different machines. I have tried with java 1.4.2 and java 1.5.0, both from Sun. I always get a signall 11 from the native libraries when they are loaded. Is this a common problem? Any help is greatly appreciated. Below is the start of the error message. More can be supplied on demand. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x65015A Function=(null)+0x65015A Library=/lib/ld-linux.so.2 NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) - locked <0xed46f628> (a java.util.Vector) - locked <0xed471708> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xed46ebc0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.InitializeDriver(CommPortIdentifier.java:213) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:248) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:351) at com.jpeterson.x10.module.CM11A.allocate(CM11A.java:1160) at net.sourceforge.cruisecontrol.publishers.X10Publisher.send(X10Publisher.java:182) at net.sourceforge.cruisecontrol.publishers.X10Publisher.turnOff(X10Publisher.java:171) at net.sourceforge.cruisecontrol.publishers.X10Publisher.handleBuild(X10Publisher.java:148) at net.sourceforge.cruisecontrol.publishers.X10Publisher.publish(X10Publisher.java:141) at net.sourceforge.cruisecontrol.Project.publish(Project.java:679) at net.sourceforge.cruisecontrol.Project.build(Project.java:227) at net.sourceforge.cruisecontrol.Project.execute(Project.java:153) at net.sourceforge.cruisecontrol.ProjectWrapper.run(ProjectWrapper.java:66) at java.lang.Thread.run(Thread.java:534) From chris_jh at blueyonder.co.uk Tue Jun 28 05:37:10 2005 From: chris_jh at blueyonder.co.uk (Christopher Harris) Date: Tue, 28 Jun 2005 12:37:10 +0100 Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError Message-ID: <42C13666.9030108@blueyonder.co.uk> Hi I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 32bit) The serial ports work fine with no issues, but when i try to use the parallel port i get this message Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:66) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) I am trying to print a line out to port "/dev/lp0" At first i thought it could not find the librxtxParallel.so file, but when i renamed it i got a different saying it could not find the library. I have tried to run as root no difference. It is really weird, i get no compile errors and the serial ports work fine. I changed the LPRPort.java and commented out the Initialize call method. And just get the same error but for the method open. It is as though it can't see the methods, and yet it can see the library. I did have a bit of check of the JNI implementation in rxtx but could not spot anything. Yours Thankfully Christopher Harris From lyon at docjava.com Thu Jun 30 02:28:09 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 04:28:09 -0400 Subject: [Rxtx] tools Message-ID: Hi All, I have been thinking about automatic cross-platform native method development of Java/C programs. It appears that different binary tools are needed to target different platforms. Configuration seems a bit painful. Is there something better available than make? Is ANT any good at this? Has anyone tried: http://jnipp.sourceforge.net/ Thanks! - Doug From lyon at docjava.com Thu Jun 30 04:11:17 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 06:11:17 -0400 Subject: [Rxtx] javax.comm Message-ID: Hi All, When I load my jar files on a linux box, all is well. However, when I load them on a mac, I get: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver The jar files for the mac are different from the jar files for linux, because recompilation of the native code for the mac has not been easy, for me. As a result, the RXTX jars are tending toward specific versions and platforms. Probably, this is not an ideal situation, but, I suspect, it is common. I have an idea that we could create a single JNLP distro site that we can make reference to that would enable a uniform repository of synchronized signed native methods and jars for RXTX. For example, the one-wire Maxim folks have a real-nice approach where their stuff makes reference to another JNLP file that contains all the stuff we need to make RXTX work. Check it out at: http://www.maxim-ic.com/products/ibutton/software/1wire/OneWireViewer.cfm However, even they have problems on an unconfigured machine: Specified adapter name "DS9097U" is not known * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cannot load default adapter. Please check that the adapter is connected and that no other application is using the port. If you have checked the adapter, the default port might not be selected. Either set the value of the TMEX default using the utility provided with the TMEX Runtime, or create a new file in the /lib folder called onewireviewer.properties with two lines, similar to the following: #native win32 drivers adapter.name={DS9097U} adapter.port=COM1 #or javax.comm drivers adapter.name=DS9097U adapter.port=COM1 The full path to this file should be: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/onewireviewer.properties ---- Wow, that is a show stopper! Configuration is something that we really need to think about as an automatic thing, particularly for web start users. You can't ask a person who wants to run an application to figure out how to alter a properties file. If you know you need one, then get permission and make one...automatically. That makes a lot of sense, to me. Basically, we need an installer. At the very least, all the pre-built binaries and jars needed for the RXTX package on several platforms should be available from a single place. One this happens, we can make a JNLP file that is platform specific, but can give us a level of indirection. Is this something that has been done already? Thanks! - Doug From taj at www.linux.org.uk Thu Jun 30 08:10:22 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 15:10:22 +0100 (BST) Subject: [Rxtx] tools In-Reply-To: References: Message-ID: On Thu, 30 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I have been thinking about automatic cross-platform > native method development of Java/C programs. > > It appears that different binary tools are needed to target different > platforms. Configuration seems a bit painful. > > Is there something better available than make? > > Is ANT any good at this? I'm far from an Ant expert but have used it for other projects. The main problem I see with ant is there is no mainstream support for platform neutral neutral library creation as far as I can tell. I think ant is a fine replacement for make but I've not seen a suitable replacement for autoconf. At that point, make is as good as anything. It should be possible to create a ant build.xml that works on say Solaris, Linux, Windows and Mac OS X. The problem is when you are trying to build a library for embeded ARM from Mac OS X. > Has anyone tried: > http://jnipp.sourceforge.net/ -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:22:02 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:22:02 +0100 (BST) Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <1119689424.12606.14.camel@BPC0276> References: <1119689424.12606.14.camel@BPC0276> Message-ID: On Sat, 25 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I am trying to get RXTX to work on Fedora Core, version 3 or 4. > > I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 > directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext > directory. > > I have edited the jre/lib/javax.comm.properties according to the docs. > > I have tried this with both rxtx 2.0 and 2.1. > > I have tried on two different machines. > > I have tried with java 1.4.2 and java 1.5.0, both from Sun. > > I always get a signall 11 from the native libraries when they are > loaded. Is this a common problem? Any help is greatly appreciated. > Below is the start of the error message. More can be supplied on > demand. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x65015A > Function=(null)+0x65015A > Library=/lib/ld-linux.so.2 > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) If you compile rxtx from source, this will probably go away. I'm not sure what the exact cause is but it looks like the binaries are not suitable for FC3/4. The ABI may have changed since those had been compiled. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:26:56 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:26:56 +0100 (BST) Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError In-Reply-To: <42C13666.9030108@blueyonder.co.uk> References: <42C13666.9030108@blueyonder.co.uk> Message-ID: tOn Tue, 28 Jun 2005, Christopher Harris wrote: > Hi > > I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 > 32bit) > > The serial ports work fine with no issues, but when i try to use the > parallel port i get this message > > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:66) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) > > > I am trying to print a line out to port "/dev/lp0" > > At first i thought it could not find the librxtxParallel.so file, but > when i renamed it i got a different saying it could not find the library. > > I have tried to run as root no difference. > > It is really weird, i get no compile errors and the serial ports work fine. > > I changed the LPRPort.java and commented out the Initialize call method. > And just get the same error but for the method open. > > It is as though it can't see the methods, and yet it can see the library. > I did have a bit of check of the JNI implementation in rxtx but could > not spot anything. > > > You can check if the symbols are in the shared library: nm librxtxSerial.so |grep Initialize If the symbols are not there, there was a build error. Watch very close for build errors while compiling from source. I suspect something isnt behaving right. -- Trent Jarvi tjarvi at qbang.org From allen at adbyrne.us Thu Jun 30 06:55:58 2005 From: allen at adbyrne.us (Allen Byrne) Date: Thu, 30 Jun 2005 07:55:58 -0500 Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> References: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> Message-ID: <200506300755.59159.allen@adbyrne.us> On Thursday 30 June 2005 00:31, rxtx-request at mail.electronpusher.org wrote: > >Message: 8 >Date: Sat, 25 Jun 2005 10:50:24 +0200 >From: Uwe Kubosch >Subject: [Rxtx] RXTX in FC3/FC4 >To: rxtx at mail.electronpusher.org >Message-ID: <1119689424.12606.14.camel at BPC0276> >Content-Type: text/plain > >Hi all! > >I am trying to get RXTX to work on Fedora Core, version 3 or 4. > >I have tried this with both rxtx 2.0 and 2.1. > >I have tried on two different machines. > >I have tried with java 1.4.2 and java 1.5.0, both from Sun. > >I always get a signall 11 from the native libraries when they are >loaded. ?Is this a common problem? ?Any help is greatly appreciated. >Below is the start of the error message. ?More can be supplied on >demand. > >An unexpected exception has been detected in native code outside the VM. >Unexpected Signal : 11 occurred at PC=0x65015A >Function=(null)+0x65015A >Library=/lib/ld-linux.so.2 > I had thi same problem on SUSE9.3 and java 1.5.0. After searching through the archives, I found a patch that required adding a sleep(1000) command in two functions of SerialIO.java. This only was for rxtx2.1, I had no trouble with rxtx2.0. Note, also I had to add the "|1.5*" sequence to the configure.in file to get good *.so libs. Again 2.0 was fine. -- Allen Byrne adbyrne at ieee.org http://modelrr.adbyrne.us From taj at www.linux.org.uk Fri Jun 3 01:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 08:57:29 +0100 (BST) Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 3 09:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 16:57:53 +0100 (BST) Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi at qbang.org From jasmine at electronpusher.org Fri Jun 3 10:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 17:12:21 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 11:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:02:09 +0100 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 11:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:05:10 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From jon.nall at gmail.com Mon Jun 6 09:13:58 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 10:13:58 -0500 Subject: [Rxtx] StackOverflowError Message-ID: I have a fairly small application that is communicating to a microcontroller programmer at 115.2k. I have a test where I try and dump the memory of the microcontroller (whose size is 8k and change). Things are going smoothly and the data looks good. Then after reading out ~6.5k of data, I get a StackOverflowError. The stack trace looks like: CommInterface.serialEvent(): 324 // this is my code RXTXPort.sendEvent(): 732 RXTXPort.eventLoop() [Native] MonitorThread.run(): 1531 I am running on windows and using rxtx-2.1-CVS-20050120. When I increased the stack size to 512k, I could read the entire chip without issue. But that doesn't seem like the right thing to do without root causing what's happening. My code doesn't include any recursion and the stack trace looks terribly short, so I'm a bit confused as to why I'm getting a StackOverflowError. CommInterface.serialEvent() does little more than grab the available bytes, enter a synchronized block, stick them in a common data area for the main thread to use and leave the synchronization block. I guess my question is: are there any known issues with the default stack size when using the latest rxtx on windows? thanks, nall. From taj at www.linux.org.uk Mon Jun 6 09:27:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 16:27:34 +0100 (BST) Subject: [Rxtx] StackOverflowError In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > I have a fairly small application that is communicating to a > microcontroller programmer at 115.2k. I have a test where I try and > dump the memory of the microcontroller (whose size is 8k and change). > Things are going smoothly and the data looks good. Then after reading > out ~6.5k of data, I get a StackOverflowError. The stack trace looks > like: > > CommInterface.serialEvent(): 324 // this is my code > RXTXPort.sendEvent(): 732 > RXTXPort.eventLoop() [Native] > MonitorThread.run(): 1531 > > I am running on windows and using rxtx-2.1-CVS-20050120. When I > increased the stack size to 512k, I could read the entire chip without > issue. But that doesn't seem like the right thing to do without root > causing what's happening. My code doesn't include any recursion and > the stack trace looks terribly short, so I'm a bit confused as to why > I'm getting a StackOverflowError. > > CommInterface.serialEvent() does little more than grab the available > bytes, enter a synchronized block, stick them in a common data area > for the main thread to use and leave the synchronization block. > > I guess my question is: are there any known issues with the default > stack size when using the latest rxtx on windows? > This is the first I've heard of the problem. It is strange as you mention lookin at the stack trace. That cant be taking up too much space. If you just toss the data instead of trying to put it in your work area, does it persist? -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Mon Jun 6 10:09:39 2005 From: lengyel at gmail.com (FL) Date: Mon, 6 Jun 2005 12:09:39 -0400 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on which the jdk1.5.0_03 is installed. I found that the INSTALL documentation seems to be in error. It states that javacomm20-x86.tar.Z (the Java Communications API for Solaris/x86) must be used, in fact this choice led to the following test with theBlackBox sample program in the commapi: root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG BlackBox -p /dev/ttyS0 Port /dev/ttyS0 not found! No serial ports found! Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to cause Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to the Eclipse stable build version 3.1M7 to avoid this. However, I found that using the Solaris/Sparc version of commapi worked on my system. I have documented this on: http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050606/b28fb9a7/attachment-0008.html From taj at www.linux.org.uk Mon Jun 6 10:30:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:30:27 +0100 (BST) Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, FL wrote: > I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on > which the jdk1.5.0_03 is installed. I found that the INSTALL documentation > seems to be in error. It states that javacomm20-x86.tar.Z (the Java > Communications API for Solaris/x86) must be used, in fact this choice led to > the following test with theBlackBox sample program in the commapi: > > root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG > BlackBox -p /dev/ttyS0 > Port /dev/ttyS0 not found! > No serial ports found! > > Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to > cause > Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to > the Eclipse stable build version 3.1M7 to avoid this. > > However, I found that using the Solaris/Sparc version of commapi > worked on my system. > > I have documented this on: > > http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 > Thanks FL. I'll change the documentation to point to the SPARC comm.jar. In the past, any Solaris was good enough, we tried to avoid the w32 comm.jar because it made native calls rxtx would never implement on any OS as they are not platform neutral. I'll withold comments about Sun's comm.jar being different on various CPUs within even the same OS. RXTX 2.1 does not need to do that even acrossed OSs for instance. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 6 10:35:43 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 11:35:43 -0500 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API Message-ID: It seems that Sun's javax.comm site does not include JavaDoc'ed API and the RxTx site has the API, but no real documentation. Is there some site that i'm just missing in my google searches? I'm looking for a copy of the javax.comm API which is documented. Thanks, nall. From taj at www.linux.org.uk Mon Jun 6 10:44:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:44:03 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > It seems that Sun's javax.comm site does not include JavaDoc'ed API > and the RxTx site has the API, but no real documentation. Is there > some site that i'm just missing in my google searches? I'm looking for > a copy of the javax.comm API which is documented. > > Thanks, > nall. Sun's version is with their binary downloads. RXTX tries to match that so I never bothered with more complete JavaDocs. Whatever Sun documents is what we try to do. -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Mon Jun 6 12:13:44 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 6 Jun 2005 14:13:44 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: Message-ID: <20050606181245.528C929D56F@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Trent Jarvi > Sent: Monday, June 06, 2005 12:44 PM > To: Jon Nall; Java RXTX discussion > Subject: Re: [Rxtx] Where can I find JavaDoc on the javax.comm API > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > It seems that Sun's javax.comm site does not include JavaDoc'ed API > > and the RxTx site has the API, but no real documentation. Is there > > some site that i'm just missing in my google searches? I'm > looking for > > a copy of the javax.comm API which is documented. > > > > Thanks, > > nall. > > Sun's version is with their binary downloads. RXTX tries to > match that so I never bothered with more complete JavaDocs. > Whatever Sun documents is what we try to do. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Try http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht ml -Ack From gadelavega at yahoo.com.ar Mon Jun 6 12:58:09 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Mon, 6 Jun 2005 15:58:09 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606181245.528C929D56F@mail.electronpusher.org> Message-ID: <20050606185809.57069.qmail@web14603.mail.yahoo.com> --- "David S. Acker" escribi?: > > -----Original Message----- > > From: rxtx-bounces at mail.electronpusher.org > > [mailto:rxtx-bounces at mail.electronpusher.org] On > Behalf Of Trent Jarvi > > Sent: Monday, June 06, 2005 12:44 PM > > To: Jon Nall; Java RXTX discussion > > Subject: Re: [Rxtx] Where can I find JavaDoc on > the javax.comm API > > > > On Mon, 6 Jun 2005, Jon Nall wrote: > > > > > It seems that Sun's javax.comm site does not > include JavaDoc'ed API > > > and the RxTx site has the API, but no real > documentation. Is there > > > some site that i'm just missing in my google > searches? I'm > > looking for > > > a copy of the javax.comm API which is > documented. > > > > > > Thanks, > > > nall. > > > > Sun's version is with their binary downloads. > RXTX tries to > > match that so I never bothered with more complete > JavaDocs. > > Whatever Sun documents is what we try to do. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > Try > http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > ml > -Ack > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > I'm prety sure it was there... but not anymore. Gonzalo A. de la Vega, BI ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From taj at www.linux.org.uk Mon Jun 6 18:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 01:09:14 +0100 (BST) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <20050606185809.57069.qmail@web14603.mail.yahoo.com> References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: >> http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.ht > > I'm prety sure it was there... but not anymore. > It is there. Maybe the URL got mangled. Try this http://tinyurl.com/8dfp7 It just redirects you to: http://java.sun.com/products/javacomm/javadocs/javax/comm/package-summary.html -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 7 05:46:39 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Jun 2005 07:46:39 -0400 Subject: [Rxtx] rxtx under fedora - odd procedures Message-ID: Hi All, I was able to get RXTX communications to work under Fedora, but only after I added myself to the UUCP and LOCK groups, logged out and then logged back in. Both groups appear to be needed in order to access the serial ports. Also the group alter did not take until after I logged out and logged back in. My theory is that you need permission to write to the var/spool directory under fedora and that this is the only way to do it. Logging out and logging back in just seems like an odd thing to do. I suppose some users may have to restart X. Ouch! Is this true? The alter_group command indicates that you need to be an su to alter the group database. Does this mean that my serial port users need a database su able person to use serial port applications under RXTX? If so, what is the procedure to make a transparent install work using Java web start? Should I be prompting users for the su password? Should I be telling users to exit from X and log out? Is this the way other serial communications programs work? Thanks! - Doug From sean_montgomery at baseview.com Tue Jun 7 08:14:51 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 7 Jun 2005 10:14:51 -0400 Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: References: <20050606185809.57069.qmail@web14603.mail.yahoo.com> Message-ID: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: >>> http://java.sun.com/products/javacomm/javadocs/javax/comm/package- >>> summary.ht >>> > > >> >> I'm prety sure it was there... but not anymore. >> >> > > It is there. Maybe the URL got mangled. Try this > > http://tinyurl.com/8dfp7 > > It just redirects you to: > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > summary.html > Maybe the issue here is that the info is available without frames from that URL, but when you try to access it with frames (from the link on that page) it doesn't work - it takes you to: http://java.sun.com/products/javacomm/javadocs/index.html Which doesn't have anything useful on it. From gadelavega at yahoo.com.ar Tue Jun 7 08:22:50 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:22:50 -0300 (ART) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: Message-ID: <20050607142251.92850.qmail@web14626.mail.yahoo.com> --- "Dr. Douglas Lyon" escribi?: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the > group > alter did not take until after I logged out and > logged back in. > > My theory is that you need permission to write to > the var/spool > directory under fedora and that this is the only way > to do it. > > Logging out and logging back in just seems like an > odd thing to > do. I suppose some users may have to restart X. > Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port > applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log > out? > Is this the way other serial communications programs > work? > > Thanks! > - Doug > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Actually, you need the lock group to acces /var/lock directory, and uucp to acces /dev/ttyS*. You (as root) shuold add all users you will allow to use the serial ports to group uucp and all the ones you'll allow to lock the ports to lock group (rxtx needs both). This is not only for rxtx, but for any use of the serial ports. Next time they login they'll be able to work, so if they are in they'll have to log out first. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From gadelavega at yahoo.com.ar Tue Jun 7 08:23:56 2005 From: gadelavega at yahoo.com.ar (Gonzalo de la Vega) Date: Tue, 7 Jun 2005 11:23:56 -0300 (ART) Subject: [Rxtx] Where can I find JavaDoc on the javax.comm API In-Reply-To: <5C081BE7-B33C-4251-8212-ED72A67FC341@baseview.com> Message-ID: <20050607142356.93815.qmail@web14624.mail.yahoo.com> --- Sean Montgomery escribi?: > > On Jun 6, 2005, at 8:09 PM, Trent Jarvi wrote: > > >>> > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > >>> summary.ht > >>> > > > > > >> > >> I'm prety sure it was there... but not anymore. > >> > >> > > > > It is there. Maybe the URL got mangled. Try this > > > > http://tinyurl.com/8dfp7 > > > > It just redirects you to: > > > > > http://java.sun.com/products/javacomm/javadocs/javax/comm/package- > > > summary.html > > > > Maybe the issue here is that the info is available > without frames > from that URL, but when you try to access it with > frames (from the > link on that page) it doesn't work - it takes you > to: > > http://java.sun.com/products/javacomm/javadocs/index.html > > Which doesn't have anything useful on it. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > That's right, my bad. ___________________________________ A tu celular ?no le falta algo? Us? Yahoo! Messenger y Correo Yahoo! en tu tel?fono celular. M?s informaci?n en http://movil.yahoo.com.ar From jon.nall at gmail.com Tue Jun 7 08:33:40 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 09:33:40 -0500 Subject: [Rxtx] performance expectations Message-ID: Hi all. I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC microcontroller. The protocol I'm using (which I didn't create) looks like this for the section of code I'm concerned with: PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data PIC -> PC: 0x01 // ACK 0xNN // First 8 bits of data 0xMM // Second 8 bits of data I issue ~2000 of these Read commands. The PIC itself has an input fifo which can store 18 bytes, so I can have 18 read commands in flight at a given time. The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k 8N1. I am measuring the time it takes to perform these 2000 commands at around 30 seconds, which is much longer than I anticipated. With the link fully utilized, I expected: Time per byte transmitted: 115200 / 8 = 14400 bytes/second = ~70 uS/byte Time per response transmitted: ~70 uS/byte * 3 bytes/response = ~210 uS/response Time for 2000 responses to be transmitted: ~210 uS/response * 2000 responses = ~420ms I'm a bit new to this, so I may have made some bad asumptions, but I would have expected a time of a couple of seconds to perform the 2000 reads, not 30+ seconds. I'm obviously missing something here. Can someone help me understand what's going on? Thanks, nall. From taj at www.linux.org.uk Tue Jun 7 09:17:48 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:17:48 +0100 (BST) Subject: [Rxtx] rxtx under fedora - odd procedures In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was able to get RXTX communications to work > under Fedora, but only after I added myself to the > UUCP and LOCK groups, logged out and then logged > back in. Both groups appear to be > needed in order to access the serial ports. Also the group > alter did not take until after I logged out and logged back in. > > My theory is that you need permission to write to the var/spool > directory under fedora and that this is the only way to do it. > > Logging out and logging back in just seems like an odd thing to > do. I suppose some users may have to restart X. Ouch! > > Is this true? > > The alter_group command indicates that you need > to be an su to alter the group database. > > Does this mean that my serial port users need a > database su able person to use serial port applications > under RXTX? > > If so, what is the procedure to make a transparent > install work using Java web start? > > Should I be prompting users for the su password? > Should I be telling users to exit from X and log out? > Is this the way other serial communications programs work? > RIght now, rxtx requires you do one of two things. 1) Use lock files (recommended). This requires intervention by the root users to allow users to create lock files and open the ports as you note. 2) configure rxtx with --disable-lockfiles. In this case you need only worry about the permissions on /dev/ttyS* I'm not sure what the default on Fedora is with respect to permisions. This is not very attractive. There is a better way it could be done on Fedora. Fedora comes with lockdev library. I've been considering this for some time. We could use that for the locking and do away with many of the problems. The problem is embeded devices running Linux do not come with liblockdev. But for your use, I would consider adding a new option for locking serial devices using liblockdev. lockdev-devel has a man page with further information. SYNOPSIS #include pid_t dev_testlock( const char * devname); pid_t dev_lock( const char * devname); pid_t dev_relock( const char * devname, pid_t pid); pid_t dev_unlock( const char * devname, pid_t pid); cc [ flag ... ] file ... -llockdev [ library ] This would probably need to be a configure time option to prevent problems on embeded Linux devices but could otherwise be the default on Linux. I could toss a quick patch together if this is confusing. It is actually easier than what rxtx does now. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 09:27:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 16:27:11 +0100 (BST) Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > Hi all. > I'm using rxtx-2.1-CVS-20050120 to communicate using RS-232 to a PIC > microcontroller. The protocol I'm using (which I didn't create) looks like this > for the section of code I'm concerned with: > > PC -> PIC: 0x29 // This is a read command. It reads 16 bits of data > PIC -> PC: 0x01 // ACK > 0xNN // First 8 bits of data > 0xMM // Second 8 bits of data > > I issue ~2000 of these Read commands. The PIC itself has an input fifo which > can store 18 bytes, so I can have 18 read commands in flight at a given time. > The PIC's output fifo is 9 bytes deep. The RS-232 link is configured to 115.2k > 8N1. > > I am measuring the time it takes to perform these 2000 commands at around 30 > seconds, which is much longer than I anticipated. With the link fully utilized, > I expected: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte > > Time per response transmitted: > ~70 uS/byte * 3 bytes/response = ~210 uS/response > > Time for 2000 responses to be transmitted: > ~210 uS/response * 2000 responses = ~420ms > > I'm a bit new to this, so I may have made some bad asumptions, but I would have > expected a time of a couple of seconds to perform the 2000 reads, not 30+ > seconds. > > I'm obviously missing something here. Can someone help me understand what's > going on? > I've hooked rxtx in loopback with a scope in the past at 9600 baud (baud rate is not important). Using event notification and just writing a byte on event/read the latencey was around 8-12 ms. The JNI is not an efficient way to use native code - especially for bit banging. So if timing is critical you want to move some of the logic into the native code rather than banging over the JNI. 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your performance. C# has advantages here. If you move your logic into the native layer or use gcj (rxtx will work with that too) most of your latency should vanish. You may have to play with some sleeps in eventLoop at that point to get full native efficiency. With gcj all of rxtx becomes 'native code' as java is just treated as a subset of C++. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 09:38:51 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 10:38:51 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: On 6/7/05, Jon Nall wrote: > Time per byte transmitted: > 115200 / 8 = 14400 bytes/second = ~70 uS/byte of course that should be divided by 10 to account for the start/stop bits, but it barely changes the end results. From carobizar at free.fr Tue Jun 7 10:21:29 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 7 Jun 2005 18:21:29 +0200 Subject: [Rxtx] (no subject) Message-ID: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Hello ! I am a french student and I have to create an application able to read and write on serial and parallel port and to run on Windows and Linux. For the moment my program run on Windows thanks the Java Communication API (version for Microsoft Windows and Solaris/x86). But it doesn't work on Linux. Does a recent version of an installation documentation exist ? I didn't find one on the RXTX site (nothing for the windows installation and the linux installation deals with a "jcl.jar" that I don't know...). So, I have some questions : 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 version or Linux&w32 version ?) What are the differences between them ? Which of them are the most stable ? 2) Where have I to put the .so and .dll files ? 3) What have I to write on the file javax.comm.properties ? 4) Have I to delete the file win32comm.dll included in the Java Comm API ? 5) Have I to keep both comm.jar and RXTXcomm.jar ? Best regards, Caroline. From debief at telemsa.com Tue Jun 7 10:44:56 2005 From: debief at telemsa.com (DEBIEF Eric) Date: Tue, 7 Jun 2005 18:44:56 +0200 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: Message-ID: <200506071844.56656.debief@telemsa.com> Hi, We are "pushing" RxTx /Java here in a half-duplex link. The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC and application handling) about 25?s/byte. The figures are the barely the same on two environments. Environment 1 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Linux 2.6.3, Mdk 10.0. RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : bytes are lost on the wire. I need to investigate this mystery.... Java : 1.4.2-rc1 Blackdown Environment 2 : PC : P-4 at 1.7 GHz, plenty of RAM. OS : Windows 2000 Pro RxTx : 2.0.7. Java : 1.4.2_08 SUN I Hope this help, Eric. _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 7 11:05:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:05:45 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, DEBIEF Eric wrote: > Hi, > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. How many write() calls is this? > > Environment 1 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Linux 2.6.3, Mdk 10.0. > RxTx : 1.4.15 oldy, but goody ;-). I've tried 2.0.7-pre2 without success : > bytes are lost on the wire. I need to investigate this mystery.... > Java : 1.4.2-rc1 Blackdown > > Environment 2 : > PC : P-4 at 1.7 GHz, plenty of RAM. > OS : Windows 2000 Pro > RxTx : 2.0.7. > Java : 1.4.2_08 SUN > In my event/read/write test I found windows was ~20% faster than linux for some reason (strange part is Windows was in VMWare on the same Linux machine). It was about the same rxtx version. There are many problems with rxtx 1.4 with respect to commapi on windows but its code paths are more simple. What some people want from rxtx is perhaps better served by hacking up the very first release as they just want to read and write which is what rxtx was before Sun released commapi. It sounds like perhaps you are pushing out larger writes which will greatly improve results. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 11:16:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 18:16:49 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118161289.42a5c989cf6a2@imp4-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: On Tue, 7 Jun 2005 carobizar at free.fr wrote: > > Hello ! > > I am a french student and I have to create an application able to read and write > on serial and parallel port and to run on Windows and Linux. > For the moment my program run on Windows thanks the Java Communication API > (version for Microsoft Windows and Solaris/x86). > But it doesn't work on Linux. > > Does a recent version of an installation documentation exist ? > I didn't find one on the RXTX site (nothing for the windows installation and the > linux installation deals with a "jcl.jar" that I don't know...). > > So, I have some questions : > > 1) Which version of RXTX have I to download ? (2.0 or 2.1 ? Linux version, w32 > version or Linux&w32 version ?) What are the differences between them ? Which > of them are the most stable ? > Use rxtx 2.0 with commapi for sparc solaris from Sun. If you want your current package javax.comm. > 2) Where have I to put the .so and .dll files ? On Linux just use the source, the configure script will do all of that for you. tar -xzvf rxtx-2.0-version mkdir rxtx-2.0-version/build cd rxtx-2.0-version/build ../configure && make install It will do everything for you. With Windows, you need to create the javax.comm.properties and install the DLL on your path. But you can just use Sun's package too. They are intended to be interchangable. > > 3) What have I to write on the file javax.comm.properties ? Driver=gnu.io.RXTXCommDriver More documentation in INSTALL that comes with the source. Sun's documentation should work too. configure does this for you on Linux. > > 4) Have I to delete the file win32comm.dll included in the Java Comm API ? > No > 5) Have I to keep both comm.jar and RXTXcomm.jar ? > Yes. RXTX 2.1 replaces comm.jar but the package is different (gnu.io) to avoid contaminating Sun's namespace. With rxtx 2.0 you need Sun's comm.jar - they work together. > > Best regards, > Caroline. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dacker at nomadio.net Tue Jun 7 12:07:34 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 14:07:34 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 Message-ID: <20050607180632.1543A29D5C8@mail.electronpusher.org> Hello, I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our product includes a built in USB to Serial adapter so that when it is connected to your PC over USB, it appears as a serial port. We had problems with Sun's comm library because it did not detect serial ports coming and going properly. I did run into a few issues with RxTx though. I am building under Windows (we support XP and 2000) under cygwin. I used a simple make file for the c code that works under cygwin and ant to build the java stuff. Attached is a diff file. The patches hit the following issues: ParallelImp.c - I am not using config so there is no config.h for me. Also, gcc didn't like a local file (win32termios.h) getting included with <> . RXTXPort.java - You can get an exception during the writeByte, writeArray, nativeDrain, readByte, read, readArray, readTerminatedArray, and nativeAvailable calls. Without this patch the IOLocked count gets stuck incremented. termios.c - If you try to open a port through CreateFile and get ERROR_ACCESS_DENIED it means someone else is using the port. We need to make sure to use serial_close instead of just close. I found that some devices finish their I/O synchronously. The code was treating this as an error. I also added some checking on the ClearError calls. I found a compile error when debugging is turned on (see the usleep change). SerialImp.c - Again, I don't have a config.h and again we must use quotes and not <> to include win32termios.h . I also commented out a report call since it seems to happen constantly on my system. Feel free to use these in any way that you want or just to ignore them. Thanks! -Dave Acker dacker at nomadio.net Software Engineer Nomadio, Inc. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diffs.txt Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/5671d159/diffs-0008.txt From jon.nall at gmail.com Tue Jun 7 12:28:16 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 13:28:16 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: <200506071844.56656.debief@telemsa.com> References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, DEBIEF Eric wrote: > We are "pushing" RxTx /Java here in a half-duplex link. > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > and application handling) about 25?s/byte. > The figures are the barely the same on two environments. Hi. This is helpful, thanks. I can think of 2 reasons I'm not collecting the data as fast as I think I should be: 1) the device to PC connection is not at 100% utilization 2) my SerialPortEventListener processing has too much overhead Are there other explanations I might be missing as to why it takes so long to transfer the data? Thanks. nall. From taj at www.linux.org.uk Tue Jun 7 13:21:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:21:46 +0100 (BST) Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On Tue, 7 Jun 2005, Jon Nall wrote: > On 6/7/05, DEBIEF Eric wrote: > > We are "pushing" RxTx /Java here in a half-duplex link. > > The results are 263 bytes send in 29ms at (115.200 kbps, 8 bits, no parity, 1 > > stop bit), about 110 ?s / byte and 8 bytes received and processed in 2ms (CRC > > and application handling) about 25?s/byte. > > The figures are the barely the same on two environments. > > Hi. > This is helpful, thanks. I can think of 2 reasons I'm not collecting > the data as fast as I think I should be: > 1) the device to PC connection is not at 100% utilization > 2) my SerialPortEventListener processing has too much overhead > > Are there other explanations I might be missing as to why it takes so > long to transfer the data? > Polling the port would probably make more sense. You can set the threshold/timeouts to avoid racing and not deal with the event notification. As mentioned earlier I think the event latency is ~10ms. Keep the event listener around, rxtx 2.* does not close well without it. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Tue Jun 7 13:27:27 2005 From: jon.nall at gmail.com (Jon Nall) Date: Tue, 7 Jun 2005 14:27:27 -0500 Subject: [Rxtx] Re: performance expectations In-Reply-To: References: <200506071844.56656.debief@telemsa.com> Message-ID: On 6/7/05, Trent Jarvi wrote: > Polling the port would probably make more sense. You can set the > threshold/timeouts to avoid racing and not deal with the event > notification. As mentioned earlier I think the event latency is ~10ms. Trent, Thanks for the response. Just to make sure I understand what you're talking about, when you say event latency, do you mean the time it takes from when the byte hits the PC's comm port to when rxtx presents it to user code? So if the link is 100% utilized, will my user code see "hiccups" or a steady stream of data? Thanks for helping a serial port newbie. nall. From dacker at nomadio.net Tue Jun 7 13:32:20 2005 From: dacker at nomadio.net (David S. Acker) Date: Tue, 7 Jun 2005 15:32:20 -0400 Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <20050607193118.5499329CAA0@mail.electronpusher.org> Some folks asked about the make file and ant steps. I have JAVA_HOME set as follows: $ echo $JAVA_HOME C:\Program Files\Java\jdk1.5.0_01 I have all the code in rxtx/src put into gnu/io . The make file here doesn't have optimizations turned on. We have not tested with it yet. --------------Begin Makefile------------------ CPPFLAGS="-I$(JAVA_HOME)/include" "-I$(JAVA_HOME)/include/win32" SOBJECTS=SerialImp.o fuserImp.o termios.o fixup.o init.o POBJECTS=ParallelImp.o termios.o init.o DLLS=rxtxParallel.dll rxtxSerial.dll all: $(CLASSES) $(DLLS) rxtxSerial.dll: $(SOBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(SOBJECTS) rxtxParallel.dll: $(POBJECTS) g++ -mno-cygwin -Wl,-add-stdcall-alias -shared -o $@ $(POBJECTS) clean: rm -fv $(SOBJECTS) $(POBJECTS) $(DLLS) %.o: %.c gcc -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< %.o: %.cpp g++ -c -mno-cygwin -Wall $(CPPFLAGS) -o $@ $< --------------End Makefile------------------ Here is the ant target I use to build the rxtx libs. Our build puts the class files in a bin dir. We copy the dlls to a deploy dir and to the build dir. Eclipse seems to like the dlls in the build dir. The deploy dir is used when we build our full package. --------------Begin Ant Section------------------ --------------End Ant Section------------------ > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > David S. Acker > Sent: Tuesday, June 07, 2005 2:08 PM > To: 'Java RXTX discussion' > Subject: [Rxtx] Patches to 2.1-7pre17 > > Hello, > I am using RxTx with the Nomadio Sensor, > http://www.nomadio.net/ . Our product includes a built in > USB to Serial adapter so that when it is connected to your PC > over USB, it appears as a serial port. We had problems with > Sun's comm library because it did not detect serial ports > coming and going properly. > > I did run into a few issues with RxTx though. I am building > under Windows (we support XP and 2000) under cygwin. I used > a simple make file for the c code that works under cygwin and > ant to build the java stuff. Attached is a diff file. The > patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h > for me. Also, gcc didn't like a local file (win32termios.h) > getting included with <> . > > RXTXPort.java - You can get an exception during the > writeByte, writeArray, nativeDrain, readByte, read, > readArray, readTerminatedArray, and nativeAvailable calls. > Without this patch the IOLocked count gets stuck incremented. > > termios.c - If you try to open a port through CreateFile and > get ERROR_ACCESS_DENIED it means someone else is using the > port. We need to make sure to use serial_close instead of > just close. I found that some devices finish their I/O > synchronously. The code was treating this as an error. I > also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we > must use quotes and not <> to include win32termios.h . I > also commented out a report call since it seems to happen > constantly on my system. > > Feel free to use these in any way that you want or just to > ignore them. > Thanks! > > -Dave Acker > dacker at nomadio.net > Software Engineer > Nomadio, Inc. > From taj at www.linux.org.uk Tue Jun 7 13:37:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 20:37:45 +0100 (BST) Subject: [Rxtx] Re: Stack Smashing Attack In-Reply-To: <200506072012.48860.ferdinand.tatzig@web.de> References: <200506072012.48860.ferdinand.tatzig@web.de> Message-ID: On Tue, 7 Jun 2005, Ferdinand Tatzig wrote: > Dear Trent > > I am using RXTX for serial port communication between a PC and a payment > transaction terminal. > When I run my application under Windows 2000, an i386-Linux or an i386-FreeBSD > it works as I expect it to do. However, when I start it to run on AMD64 > machine with a 64-bit Gentoo Linux, the VM terminates with the following > error: > > Port found: /dev/ttyS0 > java: stack smashing attack in function configure_port() > > I am using a 64-bit Blackdown-1.4.2-01 VM. > > I have searched the internet but have found no information about this error. > > This is the code of the method which initializes the serial port: > > /** > * initializes a serial port for communication with a terminal; only > * accessible within this class > * > * @param communication > * @param serialPortToBeInitialized > * @param tillInterfaceEventListener > */ > private TillInterfaceSerialPort(Communication communication, > String serialPortToBeInitialized, > TillInterfaceEventListener tillInterfaceEventListener) > throws IOException, PortInUseException, > TillInterfaceSerialPortNotFoundException, > TooManyListenersException, UnsupportedCommOperationException { > serialPortName = "not initialized yet"; > CommPortIdentifier portId = null; > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > boolean portFound = false; > String temporarySerialPortName = "not initialized yet"; > > // look for a serial port > while (portList.hasMoreElements() && !portFound) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > temporarySerialPortName = portId.getName(); > if (temporarySerialPortName.equals(serialPortToBeInitialized)) { > System.out.print("Port found: "); > System.out.println(temporarySerialPortName); > serialPortName = temporarySerialPortName; > portFound = true; > } > } > } > if (portFound) { > > // initialize the found port - this command causes the VM to terminate > serialPort = (SerialPort) portId > .open( > TillInterfaceConstants.APPLICATION_NAME, > TillInterfaceConstants > .TIMEOUT_IN_MILLISECONDS_FOR_OPENING_OF_COMMUNICATION_PORT); > > // add an event listener which listens > // on the serial port and notifies the > // serial port object when input bytes > // have been received at the port > serialPort.addEventListener(tillInterfaceEventListener); > serialPort.notifyOnDataAvailable(true); > > // initialize the physical layer > // parameters of the serial port > serialPort.setSerialPortParams(TillInterfaceConstants.BAUD_RATE, > SerialPort.DATABITS_8, SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > // set the inter-character > // timeout (T2) > serialPort > .enableReceiveTimeout(TillInterfaceConstants.INTERCHARACTER_TIMEOUT_IN_MILLISECONDS); > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > } else > throw new TillInterfaceSerialPortNotFoundException(); > } > > Any hint to solve this problem would be kindly appreciated. > The only thing that comes to mind here after looking at the offending function is rxtx used to include asm/termios.h but now we moved to termios.h and had glibc fix their headers. The asm/termios.h caused problems as its termios was smaller than the actual termios. This should be fixed in current rxtx versions but you can just glance at SerialImp.c and make sure it does not include asm/termios.h. I've cc'd the rxtx mail list because there was one other mention of stack problems recently. I have used rxtx on opteron systems with success. I have a bug I'm trying hard to reproduce on suse 64 bit (circa linux 2.4.19) systems though. So far I have not been able to reproduce the bug. That said, with gentoo... I like gentoo but I seriously doubt they do any QA with their kernel and Java. I've seen problems before. If you use gentoo and have Java problems, at least stick to Linus (that is an s there) kernels while using Java. I'm not an expert on gentoo but I've seen patches go into experimental kernels that turn out to break java and are reverted before going to Linus just before I see problems with gentoo on this list. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:16:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:16:14 +0100 (BST) Subject: [Rxtx] Patches to 2.1-7pre17 In-Reply-To: <20050607180632.1543A29D5C8@mail.electronpusher.org> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: On Tue, 7 Jun 2005, David S. Acker wrote: > Hello, > I am using RxTx with the Nomadio Sensor, http://www.nomadio.net/ . Our > product includes a built in USB to Serial adapter so that when it is > connected to your PC over USB, it appears as a serial port. We had problems > with Sun's comm library because it did not detect serial ports coming and > going properly. > > I did run into a few issues with RxTx though. I am building under Windows > (we support XP and 2000) under cygwin. I used a simple make file for the c > code that works under cygwin and ant to build the java stuff. Attached is a > diff file. The patches hit the following issues: > > ParallelImp.c - I am not using config so there is no config.h for me. Also, > gcc didn't like a local file (win32termios.h) getting included with <> . > > RXTXPort.java - You can get an exception during the writeByte, writeArray, > nativeDrain, readByte, read, readArray, readTerminatedArray, and > nativeAvailable calls. Without this patch the IOLocked count gets stuck > incremented. > > termios.c - If you try to open a port through CreateFile and get > ERROR_ACCESS_DENIED it means someone else is using the port. We need to > make sure to use serial_close instead of just close. I found that some > devices finish their I/O synchronously. The code was treating this as an > error. I also added some checking on the ClearError calls. I found a > compile error when debugging is turned on (see the usleep change). > > SerialImp.c - Again, I don't have a config.h and again we must use quotes > and not <> to include win32termios.h . I also commented out a report call > since it seems to happen constantly on my system. > > Feel free to use these in any way that you want or just to ignore them. > Thanks! > Hi Dave These patches look great as is. Thanks. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 7 14:33:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 7 Jun 2005 21:33:16 +0100 (BST) Subject: [Rxtx] Patch to IOLocked (fwd) Message-ID: This appears to be another solution to the locking. Chris, the other option just moves the locking into the finally clause which I think would be a little cleaner though I'm posting this patch to so people can comment. -- Trent Jarvi tjarvi at qbang.org ---------- Forwarded message ---------- Date: Wed, 1 Jun 2005 13:01:32 +0100 From: Christopher Dawes To: taj at www.linux.org.uk Subject: Patch to IOLocked Do you want me to check it out of CVS and then submit changes? Christopher -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXPort.java.diff Type: application/octet-stream Size: 6965 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050607/c442f9fc/RXTXPort.java-0008.obj From Christopher.Dawes at retail-logic.com Wed Jun 8 00:57:24 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 8 Jun 2005 07:57:24 +0100 Subject: [Rxtx] Patch to IOLocked (fwd) [Virus Checked] In-Reply-To: Message-ID: Agreed, much better Java :-) Thanks Christopher ------------------------------------------- Consultant Engineer Retail Logic Limited Fleet GU51 3TZ Tel: +44 (0)1252 644377 Mob: +44 (0)7899 842759 Fax: +44 (0)1252 776708 rxtx-bounces at mail.electronpusher.org wrote on 07/06/2005 21:33:16: > > This appears to be another solution to the locking. Chris, the other > option just moves the locking into the finally clause which I think would > be a little cleaner though I'm posting this patch to so people can > comment. > > -- > Trent Jarvi > tjarvi at qbang.org > > ---------- Forwarded message ---------- > Date: Wed, 1 Jun 2005 13:01:32 +0100 > From: Christopher Dawes > To: taj at www.linux.org.uk > Subject: Patch to IOLocked > > Do you want me to check it out of CVS and then submit changes? > > Christopher[attachment "RXTXPort.java.diff" deleted by Chris > Dawes/Retaillogic/NISABA] _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx From zempftman at gmail.com Wed Jun 8 07:57:25 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 09:57:25 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Maxwell Zempftman Date: May 27, 2005 5:01 PM Subject: Re: [Rxtx] Kaffe & rxtx & armv5b To: rxtx at mail.linuxgrrls.org Here are the results from working this week: The "NullPointerExceptions" are generated by the software when I choose a bad device file. I discovered that this occurs on the i686-RedHat box as well. This exception seems to be generated only by this particular application, and not by the example programs in contrib. So, for example: java MyApp /dev/null <-- generates NullPointerException java MyApp fake <-- generates NullPointerException java MyApp /dev/ttyS0 <-- does not generate NullPointerException Using the program CommCheck (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it appears as though /dev/ttyS0 is the only valid serial device file on the XScale device, so the errors I was getting are not really be bugs. Although /dev/ttyS0 did not generate NullPointerExceptions, I did encounter this error: --start java MyApp /dev/ttyS0 (going mostly from memory, not exact) PortList.hasMoreElements: true Listening on: /dev/ttyS0 Client connected. >From net: echo kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 vmExcept_setJNIFrame Assert: on 'fp != 0' failed. --end I took a look at exception.h, and it seems as though the problematic code does not exist in newer versions of Kaffe (I have been using CVS-2004-11). Next week I will try to use a newer version, although so far everything but CVS-2004-11 has failed. Also, I the device files I need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with something like this? Thanks, Max. > On 5/21/05, Trent Jarvi wrote: > > I'm not sure what is wrong in the first part. It sounds like your > > application may be swallowing an exception while trying to enumerate the > > port or open it. The usual mistake made it not having permissions to > > either open the port or create the lockfile. There should be examples in > > the contrib directory you can try that enumerate and open ports. Maybe > > that will give you some hints. > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > Sun's code limiting you there though you do need to compile and install > > rxtx for the XScale with Sun's Commapi. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > From taj at www.linux.org.uk Wed Jun 8 08:22:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 15:22:44 +0100 (BST) Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > ---------- Forwarded message ---------- > From: Maxwell Zempftman > Date: May 27, 2005 5:01 PM > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > To: rxtx at mail.linuxgrrls.org > > > Here are the results from working this week: > > The "NullPointerExceptions" are generated by the software when I > choose a bad device file. I discovered that this occurs on the > i686-RedHat box as well. This exception seems to be generated only by > this particular application, and not by the example programs in > contrib. So, for example: > > java MyApp /dev/null <-- generates NullPointerException > java MyApp fake <-- generates NullPointerException > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > Using the program CommCheck > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > appears as though /dev/ttyS0 is the only valid serial device file on > the XScale device, so the errors I was getting are not really be bugs. > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > encounter this error: > > --start > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > PortList.hasMoreElements: true > Listening on: /dev/ttyS0 > Client connected. > >From net: echo > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > --end > > I took a look at exception.h, and it seems as though the problematic > code does not exist in newer versions of Kaffe (I have been using > CVS-2004-11). Next week I will try to use a newer version, although so > far everything but CVS-2004-11 has failed. Also, I the device files I > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > something like this? > In RXTXCommDriver, just look for the following code and add /dev/ttyM to the list. Moxa? if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } So: if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyM", // for Moxa ports "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } Linux just has way too many port types to try enumerating them all. There is potential we can add them back in with udev now. > Thanks, > Max. > > > On 5/21/05, Trent Jarvi wrote: > > > I'm not sure what is wrong in the first part. It sounds like your > > > application may be swallowing an exception while trying to enumerate the > > > port or open it. The usual mistake made it not having permissions to > > > either open the port or create the lockfile. There should be examples in > > > the contrib directory you can try that enumerate and open ports. Maybe > > > that will give you some hints. > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > Sun's code limiting you there though you do need to compile and install > > > rxtx for the XScale with Sun's Commapi. > > > > > > -- > > > Trent Jarvi > > > tjarvi at qbang.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Wed Jun 8 12:16:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 08 Jun 2005 13:16:03 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A60B8D.8080500@cs.umn.edu> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> Message-ID: <42A735E3.8040706@atcorp.com> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual serial comport. This isn't so much of a problem, what is, however, is that the comport does not appear to be able to be set to any arbitrary speed, only those from the data_rate enum. I've not found much on using different speeds, has anyone else encountered anything similar? I greatly appreciate any and all comments and suggestions. Thanks in advance, ~ Shawn Lavelle From zempftman at gmail.com Wed Jun 8 12:50:58 2005 From: zempftman at gmail.com (Maxwell Zempftman) Date: Wed, 8 Jun 2005 14:50:58 -0400 Subject: Fwd: [Rxtx] Kaffe & rxtx & armv5b In-Reply-To: References: Message-ID: Thanks Trent! That will solve one of the problems. I don't know when my next chance to work on it will be, but I still need to figure out the error I got when I tried opening '/dev/ttyS0' on the Moxa device regarding a failed assertion, seemed to be a Kaffe issue. Thanks for you help, hope to have results soon, Max Englander. On 6/8/05, Trent Jarvi wrote: > On Wed, 8 Jun 2005, Maxwell Zempftman wrote: > > > ---------- Forwarded message ---------- > > From: Maxwell Zempftman > > Date: May 27, 2005 5:01 PM > > Subject: Re: [Rxtx] Kaffe & rxtx & armv5b > > To: rxtx at mail.linuxgrrls.org > > > > > > Here are the results from working this week: > > > > The "NullPointerExceptions" are generated by the software when I > > choose a bad device file. I discovered that this occurs on the > > i686-RedHat box as well. This exception seems to be generated only by > > this particular application, and not by the example programs in > > contrib. So, for example: > > > > java MyApp /dev/null <-- generates NullPointerException > > java MyApp fake <-- generates NullPointerException > > java MyApp /dev/ttyS0 <-- does not generate NullPointerException > > > > Using the program CommCheck > > (http://www.kaffe.org/pipermail/kaffe/2003-April/041779.html), it > > appears as though /dev/ttyS0 is the only valid serial device file on > > the XScale device, so the errors I was getting are not really be bugs. > > > > Although /dev/ttyS0 did not generate NullPointerExceptions, I did > > encounter this error: > > > > --start > > > > java MyApp /dev/ttyS0 (going mostly from memory, not exact) > > > > PortList.hasMoreElements: true > > Listening on: /dev/ttyS0 > > Client connected. > > >From net: echo > > > > kaffe-bin: ../../../kaffe/kaffevm/exception.h: 140 > > vmExcept_setJNIFrame Assert: on 'fp != 0' failed. > > > > --end > > > > I took a look at exception.h, and it seems as though the problematic > > code does not exist in newer versions of Kaffe (I have been using > > CVS-2004-11). Next week I will try to use a newer version, although so > > far everything but CVS-2004-11 has failed. Also, I the device files I > > need to listen on are /dev/ttyM[0-7]. Has anyone ever dealt with > > something like this? > > > > > In RXTXCommDriver, just look for the following code and add /dev/ttyM to > the list. Moxa? > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > So: > > if(osName.equals("Linux")) { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyM", // for Moxa ports > "ttyUSB" // for USB frobs > }; CandidatePortPrefixes=Temp; > } > > Linux just has way too many port types to try enumerating them all. There > is potential we can add them back in with udev now. > > > > > Thanks, > > Max. > > > > > On 5/21/05, Trent Jarvi wrote: > > > > I'm not sure what is wrong in the first part. It sounds like your > > > > application may be swallowing an exception while trying to enumerate the > > > > port or open it. The usual mistake made it not having permissions to > > > > either open the port or create the lockfile. There should be examples in > > > > the contrib directory you can try that enumerate and open ports. Maybe > > > > that will give you some hints. > > > > > > > > It is possible to use rxtx 2.0 with Sun's Commapi. There is nothing in > > > > Sun's code limiting you there though you do need to compile and install > > > > rxtx for the XScale with Sun's Commapi. > > > > > > > > -- > > > > Trent Jarvi > > > > tjarvi at qbang.org > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- > Trent Jarvi > tjarvi at qbang.org > From taj at www.linux.org.uk Wed Jun 8 12:53:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 8 Jun 2005 19:53:10 +0100 (BST) Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: <42A735E3.8040706@atcorp.com> References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: On Wed, 8 Jun 2005, Shawn Lavelle wrote: > Hello, > I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate > with a virtual serial comport. This isn't so much of a problem, what > is, however, is that the comport does not appear to be able to be set to > any arbitrary speed, only those from the data_rate enum. I've not found > much on using different speeds, has anyone else encountered anything > similar? I greatly appreciate any and all comments and suggestions. > This problem is a bit more tricky than it should be. POSIX systems just have a few specified baud rates. Solaris is one of these systems. CommAPI baud rates probably came from someone looking at Solaris. RXTX tries to be POSIX like. W32 is treated as a POSIX like system via a termios.c file in rxtx. Serial ports have baudbase and divisor. So you can set these to come close to the baudrate you want. Some funky equipment like automobile test equipment use baud rates that are not really possible with PC hardware. But if you get as close as possible by changing baud base and divisor, it works. Windows can actually do this for you. I don't know exactly what their code does but if you pass a baudrate to windows, it will guestimate a baudbase and divisor. So you just pass it 10200 baud and it does its job. This is not of very much use the way rxtx does things though. Linux has the standard POSIX like baud rates but if you set the baud rate to B38400, you can set your own baud base and divisor. This is not POSIX that I know of. W32 has more capability than POSIX like systems too. So I did some work to have windows work like Linux via termios.c But the code is not quit right. SerialImp.c and termios.c need some work so all the various buadrates work on Linux and W32. Most other systems will not work beyond what CommAPI already specifies without writting kernel drivers. This is on my todo list but if someone gets to it first, all the better. -- Trent Jarvi tjarvi at qbang.org From carobizar at free.fr Thu Jun 9 06:39:10 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Thu, 9 Jun 2005 14:39:10 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> Message-ID: <1118320750.42a8386e6d3ce@imp5-q.free.fr> Hi ! Thank you for all your advices. I managed to use rxtx on Windows but I have still some difficulties on Linux. I have yet follow your instructions and the configure file has created : - librxtxSerial.so and librxtxParallel.so in the directory /usr/java/j2sdk1.4.2_08/jre/lib/i386 - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the directory /usr/java/j2sdk1.4.2_08/jre/lib - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext But when I run my program, Some exceptions occur : Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver So, 1) What have I forgotten ? 2) Is it possible to make my application run on Linux without the jdk (only the jre) ? Best regards, Caroline. From taj at www.linux.org.uk Thu Jun 9 07:28:05 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 9 Jun 2005 14:28:05 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118320750.42a8386e6d3ce@imp5-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: On Thu, 9 Jun 2005 carobizar at free.fr wrote: > Hi ! > Thank you for all your advices. > I managed to use rxtx on Windows but I have still some difficulties on Linux. > I have yet follow your instructions and the configure file has created : > - librxtxSerial.so and librxtxParallel.so in the directory > /usr/java/j2sdk1.4.2_08/jre/lib/i386 > - a file javax.comm.properties with the content : gnu.io.RXTXCommDriver in the > directory /usr/java/j2sdk1.4.2_08/jre/lib > - comm.jar and RXTXcomm.jar in /usr/java/j2sdk1.4.2_08/jre/lib/ext > > But when I run my program, Some exceptions occur : > Caught java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path while > loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > com.sun.comm.SolarisDriver > > So, > 1) What have I forgotten ? > The native (.so) libraries are not installed in a directory the JRE is looking for native libraries in. You may look around and see where the .so libraries are in the JRE. I don't know that the jre/lib/i386 directory is specified as a required directory for JREs. I noticed some do not use it. You may try printing the java.libarary.path to see your options. It is also possible to alter the java.library.path. > 2) Is it possible to make my application run on Linux without the jdk (only the > jre) ? Yes. Though installation from source with the JDK is less error prone. -- Trent Jarvi tjarvi at qbang.org From jon.nall at gmail.com Mon Jun 13 13:47:48 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 13 Jun 2005 14:47:48 -0500 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: On 6/9/05, Trent Jarvi wrote: > On Thu, 9 Jun 2005, Jon Nall wrote: > > > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your > > > performance. C# has advantages here. If you move your logic into the > > > native layer or use gcj (rxtx will work with that too) most of your > > > latency should vanish. You may have to play with some sleeps in eventLoop > > > at that point to get full native efficiency. Hi all. As a followup to this thread, I've found that the culprit seems to be a USB to RS-232 adapter I'm using. The adapter is based on an FTDI chip and seems to have some performance issues when doing lots of small transactions. When I switched to using a native serial port, the speed of my application increased tenfold. Have people seen this type of performance degradation before when using USB to RS-232 adapters? nall. From Bob_Jacobsen at lbl.gov Mon Jun 13 15:23:18 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 14:23:18 -0700 Subject: [Rxtx] performance expectations In-Reply-To: References: Message-ID: At 2:47 PM -0500 6/13/05, Jon Nall wrote: >On 6/9/05, Trent Jarvi wrote: >> On Thu, 9 Jun 2005, Jon Nall wrote: >> >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats killing your >> > > performance. C# has advantages here. If you move your logic into the >> > > native layer or use gcj (rxtx will work with that too) most of your >> > > latency should vanish. You may have to play with some sleeps >>in eventLoop >> > > at that point to get full native efficiency. > >Hi all. >As a followup to this thread, I've found that the culprit seems to be >a USB to RS-232 adapter I'm using. The adapter is based on an FTDI >chip and seems to have some performance issues when doing lots of >small transactions. When I switched to using a native serial port, the >speed of my application increased tenfold. > >Have people seen this type of performance degradation before when >using USB to RS-232 adapters? Yes, but I've never understood it. For large transfers (100's of bytes and above), things seem just great. But for small poll/response cycles, it seems almost as if there is something in Windows that simply can't believe that there isn't more data coming, and has to go through a timeout cycle. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 19:26:33 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 21:26:33 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614012524.78F7229C09C@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 5:23 PM > To: Jon Nall; Java RXTX discussion; Trent Jarvi > Subject: Re: [Rxtx] performance expectations > > At 2:47 PM -0500 6/13/05, Jon Nall wrote: > >On 6/9/05, Trent Jarvi wrote: > >> On Thu, 9 Jun 2005, Jon Nall wrote: > >> > >> > > 10ms * 2000 = 20 seconds. Its probably the JNI layer thats > >>killing your > >> > > performance. C# has advantages here. If you move > your logic > >>into the > >> > > native layer or use gcj (rxtx will work with that > too) most of > >>your > >> > > latency should vanish. You may have to play with > some sleeps in > >>eventLoop > >> > > at that point to get full native efficiency. > > > >Hi all. > >As a followup to this thread, I've found that the culprit > seems to be a > >USB to RS-232 adapter I'm using. The adapter is based on an > FTDI chip > >and seems to have some performance issues when doing lots of small > >transactions. When I switched to using a native serial port, > the speed > >of my application increased tenfold. > > > >Have people seen this type of performance degradation before > when using > >USB to RS-232 adapters? > > Yes, but I've never understood it. > > For large transfers (100's of bytes and above), things seem > just great. But for small poll/response cycles, it seems > almost as if there is something in Windows that simply can't > believe that there isn't more data coming, and has to go > through a timeout cycle. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Skype JacobsenRG _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > The basic problem is that using a USB to Serial converter implies extra latency both at the windows driver level and possibly at the hardware level. At the windows driver level, each I/O request must go through the COM driver stack first, and then through the USB driver stack. The USB driver stack then dumps the request through the PCI stack most likely. At the hardware level the request must pass through the USB root hub, out to the remote USB device where a microcontroller (or FPGA or something similar) must catch and queue the request (the USB line rate is much faster than the RS232 line rate) and then translate the USB request into RS232. All of this extra processing doesn't show up much with large I/O requests since the transmit time over RS232 becomes dominant. With small requests the transfer time becomes small while the per request processing time remains relatively constant. Note that the vendor of the USB to Serial adapter makes a big difference. I have seem pretty big differences from one vendor to another. The Radio Shack adapter gave me nothing but blue screens and slowness. The Belkin adapter has been much better. TI has a chip that my company is using in an embedded product that has worked pretty well. -Ack From Bob_Jacobsen at lbl.gov Mon Jun 13 19:46:02 2005 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Mon, 13 Jun 2005 18:46:02 -0700 Subject: [Rxtx] performance expectations In-Reply-To: <20050614012524.78F7229C09C@mail.electronpusher.org> References: <20050614012524.78F7229C09C@mail.electronpusher.org> Message-ID: At 9:26 PM -0400 6/13/05, David S. Acker wrote: >The basic problem is that using a USB to Serial converter implies extra >latency both at the windows driver level and possibly at the hardware level. >At the windows driver level, each I/O request must go through the COM driver >stack first, and then through the USB driver stack. The USB driver stack >then dumps the request through the PCI stack most likely. At the hardware >level the request must pass through the USB root hub, out to the remote USB >device where a microcontroller (or FPGA or something similar) must catch and >queue the request (the USB line rate is much faster than the RS232 line >rate) and then translate the USB request into RS232. All of this extra >processing doesn't show up much with large I/O requests since the transmit >time over RS232 becomes dominant. With small requests the transfer time >becomes small while the per request processing time remains relatively >constant. Although this is true, I don't think that "time to get stuff done" explains what I was seeing. The application was doing about 12 to 15 polls per second (write, get a reply, repeat). This involved about 30 characters (300 bits) each for a total of about 400bps out of 56kbps. The machine was showing only a few percent busy. It definitely looked like something was waiting, not working. Bob -- Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, Skype JacobsenRG From dacker at nomadio.net Mon Jun 13 20:51:16 2005 From: dacker at nomadio.net (David S. Acker) Date: Mon, 13 Jun 2005 22:51:16 -0400 Subject: [Rxtx] performance expectations In-Reply-To: Message-ID: <20050614025009.7FD9129C28D@mail.electronpusher.org> > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of > Bob Jacobsen > Sent: Monday, June 13, 2005 9:46 PM > To: Java RXTX discussion; 'Jon Nall'; 'Trent Jarvi' > Subject: RE: [Rxtx] performance expectations > > At 9:26 PM -0400 6/13/05, David S. Acker wrote: > >The basic problem is that using a USB to Serial converter > implies extra > >latency both at the windows driver level and possibly at the > hardware level. > >At the windows driver level, each I/O request must go > through the COM > >driver stack first, and then through the USB driver stack. The USB > >driver stack then dumps the request through the PCI stack > most likely. > >At the hardware level the request must pass through the USB > root hub, > >out to the remote USB device where a microcontroller (or FPGA or > >something similar) must catch and queue the request (the USB > line rate > >is much faster than the RS232 line > >rate) and then translate the USB request into RS232. All of > this extra > >processing doesn't show up much with large I/O requests since the > >transmit time over RS232 becomes dominant. With small requests the > >transfer time becomes small while the per request processing time > >remains relatively constant. > > Although this is true, I don't think that "time to get stuff done" > explains what I was seeing. The application was doing about > 12 to 15 polls per second (write, get a reply, repeat). This > involved about 30 characters (300 bits) each for a total of > about 400bps out of 56kbps. The machine was showing only a > few percent busy. > > It definitely looked like something was waiting, not working. > > Bob > -- > Bob_Jacobsen at lbl.gov +1-510-486-7355 fax +1-510-643-8497 AIM, > Sounds like the asynchronous I/O call to the windows api WriteFile is taking a long time to signal its completion event. Odds are this is an issue with either the USB/Serial driver or the vendor's USB hardware. You could try inserting timing in termios.c before the call to WaitForSingleObject and after the return from it to see how long you are waiting on the event. -Ack -Ack From carobizar at free.fr Tue Jun 14 02:13:52 2005 From: carobizar at free.fr (carobizar@free.fr) Date: Tue, 14 Jun 2005 10:13:52 +0200 Subject: [Rxtx] Installation help In-Reply-To: References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> Message-ID: <1118736832.42ae91c022288@imp6-q.free.fr> Hello, Now I am very near of the succes ! My program which control serial ports runs perfectly on Windows and Linux ! Unfortunately, the one which control parallel ports too doesn't work neither on Windows nor on Linux... -- On Windows, the function getPortIdentifiers() does return my parallel port but when I try to open it, an exception occurs : java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:65) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) at myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) at myPackage.SignalTTL.(SignalTTL.java:81) at myPackage.SignalTTL.main(SignalTTL.java:94) I know this type of error occurs if my dll isn't in the java.library.path but here it is ! Furthermore, I've done some tests : rxtxSerial.dll and rxtxParallel.dll are in a directory known by java.library.path (C:\Program Files\Java\j2re1.4.2_06\bin). - if I remove rxtxSerial.dll from this directory , the exception "UnsatisfiedLinkError" occurs as early as the program begins. - if I remove rxtxParallel.dll from the directory, the exception occurs only when I try to open the parallel port (the behavior of my application is the same if the rxtxParallel.dll is in the directory or isn't) -- On linux, the function getPortIdentifiers() doesn't return any parallel port (but there is one !) So, is there anybody who can help me solve my problem ? Best regards, Caroline. From taj at www.linux.org.uk Tue Jun 14 15:07:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:07:14 +0100 (BST) Subject: [Rxtx] Installation help In-Reply-To: <1118736832.42ae91c022288@imp6-q.free.fr> References: <1118161289.42a5c989cf6a2@imp4-q.free.fr> <1118320750.42a8386e6d3ce@imp5-q.free.fr> <1118736832.42ae91c022288@imp6-q.free.fr> Message-ID: On Tue, 14 Jun 2005 carobizar at free.fr wrote: > Hello, > > Now I am very near of the succes ! > My program which control serial ports runs perfectly on Windows and Linux ! > Unfortunately, the one which control parallel ports too doesn't work neither on > Windows nor on Linux... > > > -- On Windows, the function getPortIdentifiers() does return my parallel port > but when I try to open it, an exception occurs : > > java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:65) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:807) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > at > myPackage.GestionnairePortParallele.ouvrirPort(GestionnairePortParallele.java:49) > at myPackage.SignalTTL.(SignalTTL.java:81) > at myPackage.SignalTTL.main(SignalTTL.java:94) > > > I know this type of error occurs if my dll isn't in the java.library.path but > here it is ! With your Linux machine run nm librxtxParallel.so |grep Initialize It should look like: 00001130 T Java_gnu_io_LPRPort_Initialize If this does not show anything, there was a problem in building the library. If it is there, you are wrong about Java finding the library. Remember the library name is case sensitive. You may do something really crude like find / -name librxtxSerial.so to make sure you understand which file is being loaded for your successful Serial install. -- Trent Jarvi tjarvi at qbang.org From lmangold at gmail.com Tue Jun 14 15:06:12 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:06:12 -0400 Subject: [Rxtx] Java Dump Message-ID: Im trying to use the Rxtx package under linux. I downloaded 2.1-7pre17, but when I try to run an app using the gnu.io/rxtx api, I get a java core dump. It is indicating that java is segfaulting in _dl_relocate_object. Any idea what this could be? This may also be an installation issue. I compiled the libraries and added the RXTXcomm.jar file to my CLASSPATH. Unfortunatley, this is where I get the problems. If I just use the comm.jar file and the javax.comm namespace, it doesnt segfault....but it also doesnt work. Or...is this impementation? Should I be using javax? I though I didnt need to in this revision? Looking for help! Thanks! --lee From lyon at docjava.com Tue Jun 14 15:13:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 14 Jun 2005 17:13:21 -0400 Subject: [Rxtx] configuration check+help=improved usability Message-ID: Hi All, I was thinking that it might be really nice to do a configuration check before trying to run RXTX. The configuration checker could make suggestions about what to do in order to fix configurations on various platforms. For example, under Fedora, you might run: public static void main(String[] args) { if (!isRxtxConfigured()) { System.out.println("user is not in uucp and lock groups.\n" + "To fix this access problem use:\n" + "sudo usermod -G uucp,lock "); } ; System.exit(0); } public static boolean isRxtxConfigured() { String s[] = groups(); return s[0].contains("uucp") && s[0].contains("lock"); } public static String[] groups() { String command = "groups "; try { return OsUtils.executeCommand(command); } catch (IOException e) { e.printStackTrace(); } return null; } Such a configuration checker would have to be created for each supported platform, with help messages that are customized for each of them. While this is not as good as automating the configuration, it might be the next best thing. Thanks! - Doug From lmangold at gmail.com Tue Jun 14 15:18:21 2005 From: lmangold at gmail.com (Lee Mangold) Date: Tue, 14 Jun 2005 17:18:21 -0400 Subject: [Rxtx] Java Dump - Solved Message-ID: I solved my problem...of course as soon as I sign up for the mailing list.... Ive done this install so many times I lost track of where everything was. I didnt have my libraries in the correct directory. In the Makefile under the 2.1-7pre17, the "install" target places the libraries in '/usr/local/java/jre/lib/$(ARCH)/' directory. I dont know about other JDKs, but the IBM JDK doesnt use that convention (at least in my case). I coppied the files to '/usr/local/java/jre/bin' instead, and viola! --lee From taj at www.linux.org.uk Tue Jun 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:32:29 +0100 (BST) Subject: [Rxtx] configuration check+help=improved usability In-Reply-To: References: Message-ID: On Tue, 14 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I was thinking that it might be really nice to do > a configuration check before trying to > run RXTX. The configuration checker could make > suggestions about what to do in order to fix configurations > on various platforms. > > For example, under Fedora, you might run: > public static void main(String[] args) { > > if (!isRxtxConfigured()) { > System.out.println("user is not in uucp and lock groups.\n" + > "To fix this access problem use:\n" + > "sudo usermod -G uucp,lock "); > } > ; > System.exit(0); > > } > > public static boolean isRxtxConfigured() { > String s[] = groups(); > return s[0].contains("uucp") && s[0].contains("lock"); > } > > > public static String[] groups() { > String command = > "groups "; > try { > return OsUtils.executeCommand(command); > } catch (IOException e) { > e.printStackTrace(); > } > return null; > } > > Such a configuration checker would have to be created for > each supported platform, with help messages that are > customized for each of them. > > While this is not as good as automating the configuration, it might be > the next best thing. > Sure. I'd suggest one other addition to this logic. It is possible to configure rxtx without lockfiles. In this case rxtx dangerously ignores all lock information. A small native function could be used to check if lockfiles are enabled. RXTXPort.java native boolean isLockEnabled(); SerialImp.c JNIEXPORT jboolean RXTXPort(isLockEnabled)( JNIEnv *env, jclass jclazz) { #ifdef DISABLE_LOCKFILES return(JNI_FALSE); #else return(JNI_TRUE); #endif /* DISABLE_LOCKFILES */ } -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 15:33:14 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 16:33:14 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: Message-ID: <42AF4D1A.90202@atcorp.com> Has anyone here noticed that virtual comports do not get enumerated via CommPortIdentifier.getPortIdentifiers()?? The device I'm trying to talk to uses an fdti usb to serial convertor with a driver that has it show up as a virtual comport. I can enter this port manually and it will be usable but I cannot get it show up automatically (as in the simple serial demo). Any thoughts on this? ~ Shawn From taj at www.linux.org.uk Tue Jun 14 15:40:54 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 22:40:54 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF4D1A.90202@atcorp.com> References: <42AF4D1A.90202@atcorp.com> Message-ID: On Tue, 14 Jun 2005, Shawn Lavelle wrote: > Has anyone here noticed that virtual comports do not get enumerated via > CommPortIdentifier.getPortIdentifiers()?? > > The device I'm trying to talk to uses an fdti usb to serial convertor > with a driver that has it show up as a virtual comport. I can enter > this port manually and it will be usable but I cannot get it show up > automatically (as in the simple serial demo). Any thoughts on this? > Hi Shawn, What OS is this and what is the name of the virtual port you are trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 16:14:16 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:14:16 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF56B8.1000305@atcorp.com> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From Christopher.Dawes at ants.me.uk Tue Jun 14 16:24:24 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Tue, 14 Jun 2005 23:24:24 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> Message-ID: <200506142224.j5EMO3ch006292@outmail.freedom2surf.net> Ooo how weird, we use the FTDI drivers as well: -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 14 June 2005 23:14 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated >>via CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are > trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Jun 14 16:29:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 14 Jun 2005 23:29:27 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF56B8.1000305@atcorp.com> References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: They will have to show up as a tty device in Linux. Probably ttyUSB? That will need an entry in RXTXCommDriver.java. If they dont show up as a tty device, rxtx cant treat it like a serial port. It just wont work. With COM3, rxtx will try to open the port and perform a timed out read. Usually if a port is not there, the read blows up or the open blows up. Timing out is fine. COM3 used to share interrupts with COM1. I know you can reassign ports in XP. RXTX scans up through COM255. You may try moving it. The code in question is the following in RXTXCommDriver.java if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } else if(osName.toLowerCase().indexOf("windows") != -1 ) { String[] Temp = { "COM" // win32 serial ports //"//./COM" // win32 serial ports }; CandidatePortPrefixes=Temp; } If COM3 can be read, it should be found. the ttyUSB should work if thats in the version of RXTXCommDriver.java you have. If this is still a problem, it may be that the driver is erroring on what may be considered normal comm port operations such as setting the speed, timeout, threshold, .. One would have to start looking at each function called in the native open() and read(). On Tue, 14 Jun 2005, Shawn Lavelle wrote: > I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > seems to find the device using rxtx. Looking at the hardware managers, > It shows up as COM3 in windows and USB bus 2, device 3 in linux. I > can't seem to get it to show up as a tty(s#) in linux which is probably > just due to my lack of significant linux knowledge. > > ~ Shawn > > Trent Jarvi wrote: > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>Has anyone here noticed that virtual comports do not get enumerated via > >>CommPortIdentifier.getPortIdentifiers()?? > >> > >>The device I'm trying to talk to uses an fdti usb to serial convertor > >>with a driver that has it show up as a virtual comport. I can enter > >>this port manually and it will be usable but I cannot get it show up > >>automatically (as in the simple serial demo). Any thoughts on this? > >> > > > > > > Hi Shawn, > > > > What OS is this and what is the name of the virtual port you are trying to > > open? I suspect the name just needs to be added to RXTXCommDriver.java. > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 14 17:07:03 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 14 Jun 2005 18:07:03 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF6317.30506@atcorp.com> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From taj at www.linux.org.uk Tue Jun 14 17:58:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 00:58:36 +0100 (BST) Subject: [Rxtx] Patches Sanity Check. Message-ID: I think everyone's patches have now made it into rxtx 2.1 CVS. If you have submitted a patch, could you double check that your changes have made it in? I may have overlooked one (I think I did thats why I'm sending this). export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (passwd mousy) cvs checkout -r commapi-0-0-1 rxtx-devel I'd like to sync rxtx 2.0 and release what we have so far if everyone has their fixes in. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 14 21:59:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 04:59:28 +0100 (BST) Subject: [Rxtx] [PATCH] liblockdev support. Message-ID: The attached patch is against rxtx 2.1 CVS for Linux based systems. It requires the lockdev package which is under the LGPL license also. It should be able to work on SysVr4 systems with some minor changes too if available. ftp://ftp.debian.org/debian/pool/main/l/lockdev/ It should be shipping with most full Linux based distributions now. After applying the patch you will need to run autoconf to generate a configure script. To use the patch, rxtx needs to be configured with configure --enable-liblock=yes After that, it should just work. I only did a quick test but it is creating and removing the lockfiles. I tried this as a regular user not in group lock and it did work as far as I can tell. Right now it does print out debug information when it creates each lockfile which should be visible during enumeration. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 15 Jun 2005 03:38:12 -0000 @@ -111,6 +111,17 @@ CFLAGS=$CFLAGS" -DDISABLE_LOCKFILES" fi ) +AC_ARG_ENABLE(liblock, + [ --enable-liblock[=x] enable liblock [default=no]], + if test "x$liblock" != "xno"; then + echo "Using liblock" + CFLAGS=$CFLAGS" -DLIBLOCKDEV" + LDFLAGS=$LDFLAGS" -llockdev" + else + echo $liblock + echo "Disabling liblock" + fi +) AC_ARG_ENABLE(lockfile_server, [ --enable-lockfile_server Enable interaction with a lock file server [default=no]], @@ -432,7 +443,7 @@ [ case $OS_NAME in Linux) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" check_kernel_headers check_java_headers CFLAGS=$CFLAGS" -D__need_timespec" @@ -485,7 +496,7 @@ beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" #echo ---------------------------- #echo $target_os #echo ---------------------------- @@ -502,7 +513,7 @@ ;; *BSD) - LDFLAGS=-lc_r + LDFLAGS=$LDFLAGS" -lc_r" JHOME=$JPATH/"lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ @@ -563,7 +574,7 @@ # FIXME UnixWare|OpenUNIX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" JHOME=$JPATH/"jre/lib" CFLAGS=$CFLAGS" -D_NO_POSIX=1 -D_NO_XOPEN4=1 -D__unixware__" CLASSPATH="-classpath .:\$(TOP):\$(TOP)/src:\$(JPATH)/jre/lib/rt.jar:\$(JPATH)/jre/lib/ext/comm.jar" @@ -575,7 +586,7 @@ ;; HP-UX) - LDFLAGS=-lpthread_this_may_be_wrong__trent + LDFLAGS=$LDFLAGS" -lpthread_this_may_be_wrong__trent" CFLAGS=$CFLAGS" -g -Aa +e -D__hpux__ -D_HPUX_SOURCE -D_NO_POSIX=1 -D_NO_XOPEN4=1" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" TARGETLIB="\$(target_triplet)/librxtxSerial.la" @@ -629,7 +640,7 @@ CLASSPATH=".:\$(TOP):\$(TOP)/../src:\$(JPATH)/share/kaffe/Klasses.jar:\$(JPATH)/lib/RXTXcomm.jar:$CLASSPATH" TARGETLIB="\$(target_triplet)/librxtxSerial.la" EXTENSION="cpp" - LDFLAGS="-ldevice" + LDFLAGS=$LDFLAGS" -ldevice" # sigh, from ltconfig # beos*) # if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then @@ -678,14 +689,14 @@ RXTX_PATH="/usr/lib/java" JHOME=$JPATH"/lib/ext" CFLAGS=$CFLAGS" -bundle" - LDFLAGS="$LDFLAGS -module -framework JavaVM -framework IOKit -framework CoreFoundation" + LDFLAGS=$LDFLAGS " -module -framework JavaVM -framework IOKit -framework CoreFoundation" CLASSPATH=".:\$(TOP):\$(TOP)/src:\$(JPATH)/lib/ext/RXTXcomm.jar:$CLASSPATH" # email taj at www.linux.org.uk if you know a nicer fix. Needed anymore? LIBTOOL_FIX="sed s/echo\ so/echo\ jnilib/g libtool > tmp; mv tmp libtool; chmod +x libtool;" ;; Solaris*) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS " -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la \ \$(target_triplet)/librxtxParallel.la" JHOME=$JPATH/"lib" @@ -722,7 +733,7 @@ ;; Compaq\'s\ Digital\ Unix | OSF1 ) - LDFLAGS=-lpthread + LDFLAGS=$LDFLAGS" -lpthread" TARGETLIB="\$(target_triplet)/librxtxSerial.la" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" JHOME=$JPATH/"lib" Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 03:38:14 -0000 @@ -104,6 +104,9 @@ #include #endif /* HAVE_GRP_H */ #include +#ifdef LIBLOCKDEV +#include +#endif /* LIBLOCKDEV */ extern int errno; @@ -4967,6 +4970,69 @@ return 1; } #endif /* LFS */ + +/*---------------------------------------------------------- + lib_lock_dev_unlock + + accept: The name of the device to try to unlock + perform: Remove a lock file if there is one using a + lock file server. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_unlock( const char *filename, int pid ) +{ + if( dev_unlock( filename, pid ) ) + { + report("fhs_unlock: Unable to remove LockFile\n"); + return(1); + } + return(0); +} +#endif /* LIBLOCKDEV */ + +/*---------------------------------------------------------- + lib_lock_dev_lock + + accept: The name of the device to try to lock + termios struct + perform: Create a lock file if there is not one already. + return: 1 on failure 0 on success + exceptions: none + comments: This is for use with liblockdev which comes with Linux + distros. I suspect it will be problematic with embeded + Linux. taj + + One could load the library here rather than link it and + always try to use this. + +----------------------------------------------------------*/ +#ifdef LIBLOCKDEV +int lib_lock_dev_lock( const char *filename, int pid ) +{ + char message[80]; + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { + report( "fhs_lock() lockstatus fail\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { + sprintf( message, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); + return 1; + } + return( 0 ); +} +#endif /* LIBLOCKDEV */ /*---------------------------------------------------------- fhs_lock Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.48 diff -u -r1.11.2.48 SerialImp.h --- src/SerialImp.h 16 Oct 2004 16:20:36 -0000 1.11.2.48 +++ src/SerialImp.h 15 Jun 2005 03:38:14 -0000 @@ -325,8 +325,13 @@ # define LOCK fhs_lock # define UNLOCK fhs_unlock #elif defined(FHS) +#ifdef LIBLOCKDEV +# define LOCK lib_lock_dev_lock +# define UNLOCK lib_lock_dev_unlock +#else # define LOCK fhs_lock # define UNLOCK fhs_unlock +#endif /* LIBLOCKDEV */ #else # define LOCK system_does_not_lock # define UNLOCK system_does_not_unlock @@ -423,6 +428,8 @@ int check_lock_status( const char * ); int lfs_unlock(const char *, int ); int lfs_lock( const char *, int); +int lib_lock_dev_unlock(const char *, int ); +int lib_lock_dev_lock( const char *, int); void fhs_unlock(const char *, int ); int fhs_lock( const char *, int); void uucp_unlock( const char *, int ); From Christopher.Dawes at retail-logic.com Wed Jun 15 02:28:15 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 09:28:15 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42AF6317.30506@atcorp.com> Message-ID: Sorry I messed up last night and sent the wrong e-mail, I meant to say we are using: Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified version.? One driver package for all Windows versions. on windows xp sp2 and all seems to work very well (there was a problem with unplugging the device and re-pkugging on the fly however there is now a patch for that). Sorry to be so unhelpful but maybe try updating your FTDI driver from http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real problems with things like Belking USB 2 Serial adaptors christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 00:07 Checked] Please respond to Java RXTX discussion Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 03:52:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 05:52:45 -0400 Subject: [Rxtx] Fedora Port Testing Message-ID: Hi All, I am trying to test a modem hooked to the com port of my Fedora 2 box. RXTX is not working, but it does list the ports. I am trying to figure out if my problem is hardware or software. fuser /dev/ttyS0 I am using Mini com, but I cannot get an "ok" prompt back from the modem. I tried /dev/ttyS1 as well, but to no avail. Thanks! - Doug From slavelle at atcorp.com Wed Jun 15 08:02:23 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Wed, 15 Jun 2005 09:02:23 -0500 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: References: Message-ID: <42B034EF.40704@atcorp.com> Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From Christopher.Dawes at retail-logic.com Wed Jun 15 08:59:32 2005 From: Christopher.Dawes at retail-logic.com (Christopher.Dawes@retail-logic.com) Date: Wed, 15 Jun 2005 15:59:32 +0100 Subject: [Rxtx] Virtual Com Ports [Virus Checked] In-Reply-To: <42B034EF.40704@atcorp.com> Message-ID: ahhh, yes we only use the FTDI system at <= 38,400 we've been assured by our supplier that the system will not work faster on the other end so appologies. Christopher Shawn Lavelle To Sent by: Java RXTX discussion rxtx-bounces at mail .electronpusher.o cc rg Subject Re: [Rxtx] Virtual Com Ports [Virus 15/06/2005 15:02 Checked] Please respond to Java RXTX discussion Yes, that is the driver we're using on windows and it does work great, except with the difficulties of attempting to set it to 250000 baud using rxtx and java. ~ Shawn Christopher.Dawes at retail-logic.com wrote: > Sorry I messed up last night and sent the wrong e-mail, I meant to say we > are using: > Windows XP R9052154 1.00.2154 20th April 2004 Microsoft WHQL certified > version. One driver package for all Windows versions. > on windows xp sp2 and all seems to work very well (there was a problem with > unplugging the device and re-pkugging on the fly however there is now a > patch for that). > > Sorry to be so unhelpful but maybe try updating your FTDI driver from > http://www.ftdichip.com/Drivers/FT232-FT245Drivers.htm as I have real > problems with things like Belking USB 2 Serial adaptors > > christopher > > > > > Shawn Lavelle > com> To > Sent by: Java RXTX discussion > rxtx-bounces at mail > .electronpusher.o cc > rg > Subject > Re: [Rxtx] Virtual Com Ports [Virus > 15/06/2005 00:07 Checked] > > > Please respond to > Java RXTX > discussion > onpusher.org> > > > > > > > Hmm, the latter sounds like a lot of work. It does find the virtual > comport in windows, i must have just missed it earlier (sign of a long > day). On the linux side, I suspect that something is not correct with > the driver installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > >>They will have to show up as a tty device in Linux. Probably ttyUSB? >>That will need an entry in RXTXCommDriver.java. If they dont show up as > > a > >>tty device, rxtx cant treat it like a serial port. It just wont work. >> >>With COM3, rxtx will try to open the port and perform a timed out read. >>Usually if a port is not there, the read blows up or the open blows up. >>Timing out is fine. COM3 used to share interrupts with COM1. I know you > > >>can reassign ports in XP. RXTX scans up through COM255. You may try >>moving it. >> >> >>The code in question is the following in RXTXCommDriver.java >> >> >> if(osName.equals("Linux")) >> { >> String[] Temp = { >> "ttyS", // linux Serial Ports >> "ttySA", // for the IPAQs >> "ttyUSB" // for USB frobs >> }; >> CandidatePortPrefixes=Temp; >> } >> >> else if(osName.toLowerCase().indexOf("windows") != -1 ) >> { >> String[] Temp = { >> "COM" // win32 serial ports >> //"//./COM" // win32 serial ports >> }; >> CandidatePortPrefixes=Temp; >> } >> >>If COM3 can be read, it should be found. the ttyUSB should work if thats > > >>in the version of RXTXCommDriver.java you have. >> >>If this is still a problem, it may be that the driver is erroring on what > > >>may be considered normal comm port operations such as setting the speed, >>timeout, threshold, .. One would have to start looking at each function >>called in the native open() and read(). >> >> >> >>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >> >> >> >>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>seems to find the device using rxtx. Looking at the hardware managers, >>>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>>can't seem to get it to show up as a tty(s#) in linux which is probably >>>just due to my lack of significant linux knowledge. >>> >>> ~ Shawn >>> >>>Trent Jarvi wrote: >>> >>> >>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>> >>>> >>>> >>>> >>>>>Has anyone here noticed that virtual comports do not get enumerated via > > >>>>>CommPortIdentifier.getPortIdentifiers()?? >>>>> >>>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>>with a driver that has it show up as a virtual comport. I can enter >>>>>this port manually and it will be usable but I cannot get it show up >>>>>automatically (as in the simple serial demo). Any thoughts on this? >>>>> >>>> >>>> >>>>Hi Shawn, >>>> >>>>What OS is this and what is the name of the virtual port you are trying > > to > >>>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>>> >>> >>>_______________________________________________ >>>Rxtx mailing list >>>Rxtx at mail.electronpusher.org >>>http://www.electronpusher.org/mailman/listinfo/rxtx >>> >> >> > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From lyon at docjava.com Wed Jun 15 09:13:00 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 15 Jun 2005 11:13:00 -0400 Subject: [Rxtx] cvs release bugs Message-ID: Hi All, Under Fedora 2 I ran configure and then make. The errors that I got follow. Am I doing something wrong? Thanks! - DL /bin/sh: line 1: cd: /usr/ph: No such file or directory gcc -I/home/lyon/current/java/serial/cvs/rxtx-devel -I/usr/ph -I. -I/usr/java/jd k1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_POSIX_SOUR CE -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/rxtx-de vel/./src/SerialImp.c -fPIC -DPIC -o /home/lyon/current/java/serial/cvs/rxtx-de vel//usr/ph/SerialImp.lo /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:25:29: gnu_io_RXTX Port.h: No such file or directory In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:30: /usr/include/time.h:120: parse error before "__time_t" /usr/include/time.h:122: parse error before '}' token In file included from /usr/include/sys/stat.h:105, from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:36: /usr/include/bits/stat.h:70: field `st_atim' has incomplete type /usr/include/bits/stat.h:71: field `st_mtim' has incomplete type /usr/include/bits/stat.h:72: field `st_ctim' has incomplete type In file included from /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialIm p.c:110: /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: parse error be fore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:91: warning: no se micolon at end of struct or union /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:92: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: parse error be fore "jclazz" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:93: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: parse error be fore "send_event" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: parse error be fore "checkMonitorThread" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:95: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:107: parse error b efore '}' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:402: parse error b efore "JNIEnv" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:403: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:404: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:405: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:406: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:410: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:411: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: parse error b efore "is_interrupted" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:412: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: parse error b efore "jint" /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:413: `send_event' redeclared as different kind of symbol /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:94: previous decla ration of `send_event' /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:419: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.h:434: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:112: warning: data definition has no type or storage class /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:202: parse error b efore '*' token /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:206: return type i s an incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c: In function `buil d_threadsafe_eis': /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: variable `mye is' has initializer but incomplete type /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: `eis' undecla red (first use in this function) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: (Each undecla red identifier is reported only once /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: for each func tion it appears in.) /home/lyon/current/java/serial/cvs/rxtx-devel/src/SerialImp.c:207: storage size of `myeis' isn't known From Mel.Bartels at weyerhaeuser.com Wed Jun 15 09:33:09 2005 From: Mel.Bartels at weyerhaeuser.com (Bartels, Mel) Date: Wed, 15 Jun 2005 08:33:09 -0700 Subject: [Rxtx] Virtual Com Ports [Virus Checked] Message-ID: <1C153DD623208B4AB8D01006A82749310B12A8@wawtcixm16.corp.weyer.pri> >as I have real problems with things like Belking USB 2 Serial adaptors Many people report trouble with this hardware, including people using serial drivers other than RXTX. The simplest cure may be to switch to another adapter. Mel Bartels From taj at www.linux.org.uk Wed Jun 15 10:29:07 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 17:29:07 +0100 (BST) Subject: [Rxtx] cvs release bugs In-Reply-To: References: Message-ID: > Under Fedora 2 I ran configure and then make. > > The errors that I got follow. > Am I doing something wrong? > Thanks! > - DL > /bin/sh: line 1: cd: /usr/ph: No such file or directory [train wreck follows] I'm not sure where the /usr/ph came from. I doubt we have the whole story there. start with a clean environment. unset JAVA_HOME thats often pointing to something old. which javac checks that which javac is pointing to the correct javac on your PATH. untar or cvs checkout the rxtx you are interested. Old builds in the tree can cause problems. with foo being the release information or devel for cvs checkout: mkdir rxtx-foo/build cd rxtx-foo/build ../configure make That way you can delete build and start over if you change your environment. if you still get /usr/ph mail me the Makefile off the list. Your build falls to pieces after trying to change to that directory. Make sure you have no spaces in your directory names. That can cause problems as I don't check for spaces. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 10:51:44 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:51:44 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05CA0.3030909@uol.com.br> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Wed Jun 15 11:07:24 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 18:07:24 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B05CA0.3030909@uol.com.br> References: <42B05CA0.3030909@uol.com.br> Message-ID: On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Hi, I'm having the following problem: when I'm reading from the serial > port, I get a lot of garbage thta was written. Is there anyway to clear > the input before reading? I searched through the mail list archive, but > didn't find anything conclusive. Any response is deeply appreciated. > I dont think this is specified in CommAPI at all. If you found something, please let me know. So what you are asking for is an extension to commapi or a change in the open() behavior that is not documented. In Linux/Unix, you can do this in the native open code with the following: tcflush( fd , TCIFLUSH ); search for RXTX.open. The code should be placed after OPEN() man termios documents this for the C API. It looks like I have implemented this in the w32 termios.c so the above change should just work in w32 too. Obviously it has not been tested. If there is a real need for accessing this functionality from Java, we could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with whatever Sun documents though. -- Trent Jarvi tjarvi at qbang.org From frank-list at uol.com.br Wed Jun 15 13:47:46 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 16:47:46 -0300 Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> Message-ID: <42B085E2.30009@uol.com.br> Thanks for the quick response. I realize now that there were some info missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush function in the termios.c really does what I need. I have two questions: 1.You said that maybe this function might have a call in Java in version 2.1, can you tell me when this will be decided? Because based on this, I will decide if I wait for version this build of 2.1 2.in the tcflush function, when PurgeComm is called, it is used PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? Thanks, Francisco Trent Jarvi wrote: >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > >>Hi, I'm having the following problem: when I'm reading from the serial >>port, I get a lot of garbage thta was written. Is there anyway to clear >>the input before reading? I searched through the mail list archive, but >>didn't find anything conclusive. Any response is deeply appreciated. >> >> >> > >I dont think this is specified in CommAPI at all. If you found something, >please let me know. > >So what you are asking for is an extension to commapi or a change in the >open() behavior that is not documented. > > >In Linux/Unix, you can do this in the native open code with the following: > > tcflush( fd , TCIFLUSH ); > >search for RXTX.open. The code should be placed after OPEN() man termios >documents this for the C API. > >It looks like I have implemented this in the w32 termios.c so the above >change should just work in w32 too. Obviously it has not been tested. > >If there is a real need for accessing this functionality from Java, we >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with >whatever Sun documents though. > > > > From taj at www.linux.org.uk Wed Jun 15 14:28:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 15 Jun 2005 21:28:53 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: <42B085E2.30009@uol.com.br> References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: The following patch should not cause anyone problems and could go in easily. Could you review that its doing what you want? I can build a test .dll on the bob account if thats what you are after. The patch is against cvs 2.1 HEAD. On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > Thanks for the quick response. I realize now that there were some info > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > function in the termios.c really does what I need. I have two questions: > 1.You said that maybe this function might have a call in Java in version > 2.1, can you tell me when this will be decided? Because based on this, > I will decide if I wait for version this build of 2.1 > 2.in the tcflush function, when PurgeComm is called, it is used > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > Thanks, > Francisco > > Trent Jarvi wrote: > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > >>port, I get a lot of garbage thta was written. Is there anyway to clear > >>the input before reading? I searched through the mail list archive, but > >>didn't find anything conclusive. Any response is deeply appreciated. > >> > >> > >> > > > >I dont think this is specified in CommAPI at all. If you found something, > >please let me know. > > > >So what you are asking for is an extension to commapi or a change in the > >open() behavior that is not documented. > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > tcflush( fd , TCIFLUSH ); > > > >search for RXTX.open. The code should be placed after OPEN() man termios > >documents this for the C API. > > > >It looks like I have implemented this in the w32 termios.c so the above > >change should just work in w32 too. Obviously it has not been tested. > > > >If there is a real need for accessing this functionality from Java, we > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > >whatever Sun documents though. > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 15 Jun 2005 20:23:50 -0000 @@ -1666,6 +1666,8 @@ throws UnsupportedCommOperationException; private native boolean nativeGetCallOutHangup() throws UnsupportedCommOperationException; + private native boolean nativeClearCommInput() + throws UnsupportedCommOperationException; /** * Extension to CommAPI @@ -2186,6 +2188,20 @@ if ( debug ) z.reportln( "RXTXPort:getCallOutHangup()"); return nativeGetCallOutHangup(); + } + + /** + * Extension to CommAPI + * returns boolean true on success + * @throws UnsupportedCommOperationException + */ + + public boolean clearCommInput() + throws UnsupportedCommOperationException + { + if ( debug ) + z.reportln( "RXTXPort:clearCommInput()"); + return nativeClearCommInput(); } /*------------------------ END OF CommAPI Extensions -----------------------*/ Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 15 Jun 2005 20:23:52 -0000 @@ -3304,6 +3304,23 @@ } /*---------------------------------------------------------- +RXTXPort.nativeClearCommInput + + accept: none + perform: try to clear the input. + return: true on success, false on error + exceptions: none + comments: This is an extension to commapi. +----------------------------------------------------------*/ +JNIEXPORT jboolean JNICALL RXTXPort(nativeClearCommInput)( JNIEnv *env, + jobject jobj ) +{ + int fd = get_java_var( env, jobj, "fd", "I" ); + if ( tcflush( fd, TCIFLUSH ) ) + return( JNI_FALSE ); + return( JNI_TRUE ); +} +/*---------------------------------------------------------- RXTXPort.readTerminatedArray accept: offset (offset to start storing data in the jbarray) and Index: src/termios.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/termios.c,v retrieving revision 1.9.2.54 diff -u -r1.9.2.54 termios.c --- src/termios.c 10 Jun 2005 19:50:31 -0000 1.9.2.54 +++ src/termios.c 15 Jun 2005 20:23:52 -0000 @@ -2573,7 +2573,7 @@ switch( queue_selector ) { case TCIFLUSH: - if ( !PurgeComm( index->hComm, PURGE_RXABORT ) ) + if ( !PurgeComm( index->hComm, PURGE_RXCLEAR ) ) { goto fail; } From taj at www.linux.org.uk Thu Jun 16 08:34:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 15:34:10 +0100 (BST) Subject: [Rxtx] Clearing Input In-Reply-To: References: <42B05CA0.3030909@uol.com.br> <42B085E2.30009@uol.com.br> Message-ID: Francisco noted this was not working for him (though tested with rxtx 2.0. "I couldn't test with version 2.1, because I would have to change more of the app code than I intended, since it doesn't use the javax.comm API, so I tested this on the 2.0pre7 code. I altered the tcflush code to use the PURGE_RXCLEAR flag instead of the abort flag and put a call to tcflush in the open function in SerialImp.c just before the call to "return (jint) fd;", but it didn't work. Maybe something else is missing, or the abort flag should be used after all." On Wed, 15 Jun 2005, Trent Jarvi wrote: > > The following patch should not cause anyone problems and could go in > easily. Could you review that its doing what you want? I can build a > test .dll on the bob account if thats what you are after. > > The patch is against cvs 2.1 HEAD. > > On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > Thanks for the quick response. I realize now that there were some info > > missing: I'm using win2k and rxtx version 2.0pre7. I saw the tcflush > > function in the termios.c really does what I need. I have two questions: > > 1.You said that maybe this function might have a call in Java in version > > 2.1, can you tell me when this will be decided? Because based on this, > > I will decide if I wait for version this build of 2.1 > > 2.in the tcflush function, when PurgeComm is called, it is used > > PURGE_RXABORT, wouldn't it be better to use PURGE_RXCLEAR instead? > > > > Thanks, > > Francisco > > > > Trent Jarvi wrote: > > > > >On Wed, 15 Jun 2005, Francisco Areas Guimaraes wrote: > > > > > > > > > > > >>Hi, I'm having the following problem: when I'm reading from the serial > > >>port, I get a lot of garbage thta was written. Is there anyway to clear > > >>the input before reading? I searched through the mail list archive, but > > >>didn't find anything conclusive. Any response is deeply appreciated. > > >> > > >> > > >> > > > > > >I dont think this is specified in CommAPI at all. If you found something, > > >please let me know. > > > > > >So what you are asking for is an extension to commapi or a change in the > > >open() behavior that is not documented. > > > > > > > > >In Linux/Unix, you can do this in the native open code with the following: > > > > > > tcflush( fd , TCIFLUSH ); > > > > > >search for RXTX.open. The code should be placed after OPEN() man termios > > >documents this for the C API. > > > > > >It looks like I have implemented this in the w32 termios.c so the above > > >change should just work in w32 too. Obviously it has not been tested. > > > > > >If there is a real need for accessing this functionality from Java, we > > >could easily add yet another extension in rxtx 2.1. rxtx 2.0 sticks with > > >whatever Sun documents though. > > > > > > > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at mail.electronpusher.org > > http://www.electronpusher.org/mailman/listinfo/rxtx > > > > -- Trent Jarvi tjarvi at qbang.org From mark at panonet.net Thu Jun 16 09:05:33 2005 From: mark at panonet.net (Mark Anderson) Date: Thu, 16 Jun 2005 16:05:33 +0100 Subject: [Rxtx] Further EINTR patch for CNI Message-ID: <42B1953D.3090402@panonet.net> Trent, Please find attached a patch which seems to resolve this issue once and for all! Thanks, Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SerialImp.patch Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20050616/80224582/SerialImp-0008.pl From taj at www.linux.org.uk Thu Jun 16 09:28:18 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 16 Jun 2005 16:28:18 +0100 (BST) Subject: [Rxtx] Further EINTR patch for CNI In-Reply-To: <42B1953D.3090402@panonet.net> References: <42B1953D.3090402@panonet.net> Message-ID: On Thu, 16 Jun 2005, Mark Anderson wrote: > Trent, > > Attached is a final patch which seems to solve this issue once and for all. > > Thanks, > Mark > --- SerialImp.c.cvs Thu Jun 16 11:58:03 2005 +++ SerialImp.c Thu Jun 16 12:00:53 2005 @@ -2878,7 +2878,9 @@ // ignore SIGPWR + SIGXCPU during SELECT as gcj GC uses these signals sigprocmask(SIG_BLOCK, &sigpwr_mask, NULL); + do { ret = SELECT(fd + 1, &rset, NULL, NULL, tvP); + } while( ret < 0 && errno == EINTR); sigprocmask(SIG_UNBLOCK, &sigpwr_mask, NULL); if (ret == -1){ report( "read_byte_array: select returned -1\n" ); Thanks Mark. This is in CVS now. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Thu Jun 16 09:38:27 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Thu, 16 Jun 2005 08:38:27 -0700 Subject: [Rxtx] NoSuchPortException on Mac OS Tiger Message-ID: <42B19CF3.6050602@gmail.com> Hello everyone, we're using the 20050120 snapshot on Tiger. We've set the gnu.io.rxtx.SerialPorts property to include the device we're trying to use, which is a bluetooth virtual serial port. We've had no luck, getting NoSuchPortExceptions for it. We also tried /dev/cu.modem and /dev/tty.modem, and had the same exception thrown. Both the modem and the blueooth virtual port work with ZTerm. Any ideas? We'd love to hear from people that are using rxtx with Tiger and compare notes... Cheers Dimitris. From lyon at docjava.com Fri Jun 17 02:37:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 04:37:22 -0400 Subject: [Rxtx] fns_lock() Message-ID: Hi All, On Fedora 2, when I open a port, things appear to work OK. However, the second time I open a port I get: RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists Experimental: JNI_OnLoad called. I am using: RXTX-2.1-7pre20 This was working fine under mac osx.... Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 08:55:44 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 15:55:44 +0100 (BST) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > On Fedora 2, when I open a port, things appear to work OK. > However, the second time I open a port I get: > RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File exists > Experimental: JNI_OnLoad called. > I am using: > RXTX-2.1-7pre20 > > This was working fine under mac osx.... > Did you close the port in between the opens? If you are opening the port twice without closing, thats an error and why rxtx is checking lockfiles. Imagine two threads/applications reading the same port and only getting 1/2 the data each. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 12:57:56 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 11:57:56 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 Message-ID: <42B31D34.4070805@gmail.com> Hi, In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, running rxtx 2.0-CVS-20050120 results in this: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver inside a NoSuchPortException. Making this change: --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 @@ -60,7 +60,7 @@ /** This is the JavaComm for Linux driver. */ -public class RXTXCommDriver implements CommDriver +public class RXTXCommDriver implements javax.comm.CommDriver { private final static boolean debug = false; on the 20050120 snapshot's code and substituting the jar fixes the problem. The diff above is from CVS, but the implements clause is identical in CVS and 20050120. Am I missing something obvious about classpath resolution or the 1.5 javac here? Thanks D. From taj at www.linux.org.uk Fri Jun 17 13:16:21 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:16:21 +0100 (BST) Subject: [Rxtx] Pending admin held messages comming Message-ID: I just realized the noticices for held emails are not being sent to me after we moved to electronpushers.org. There will be ~5 messages comming. -- Trent Jarvi tjarvi at qbang.org From lavelle at cs.umn.edu Tue Jun 14 16:12:12 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:12:12 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> Message-ID: <42AF563C.6060404@cs.umn.edu> I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one seems to find the device using rxtx. Looking at the hardware managers, It shows up as COM3 in windows and USB bus 2, device 3 in linux. I can't seem to get it to show up as a tty(s#) in linux which is probably just due to my lack of significant linux knowledge. ~ Shawn Trent Jarvi wrote: > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>Has anyone here noticed that virtual comports do not get enumerated via >>CommPortIdentifier.getPortIdentifiers()?? >> >>The device I'm trying to talk to uses an fdti usb to serial convertor >>with a driver that has it show up as a virtual comport. I can enter >>this port manually and it will be usable but I cannot get it show up >>automatically (as in the simple serial demo). Any thoughts on this? >> > > > Hi Shawn, > > What OS is this and what is the name of the virtual port you are trying to > open? I suspect the name just needs to be added to RXTXCommDriver.java. > From tjarvi at qbang.org Fri Jun 17 12:32:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 17 Jun 2005 14:32:40 -0400 (EDT) Subject: [Rxtx] fns_lock() In-Reply-To: References: Message-ID: >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.\uffff >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. > Thanks for your prompt reply. > The error appears when: > CommPortIdentifier.getPortIdentfiers() > is invoked. > Do we really need to lock the comm ports in order > to list them? > They were left open by a previous run of a program. > > This is a bit of a chicken and egg issue, I can't close > the ports if I can't list them, right? > [forwarded to rxtx mail-list as others probably run into this] It is a bit of a chicken and the egg issue but what rxtx is trying to avoid is the following: pppd has /dev/ttyS3 open (a modem) for an internet connection. It locks the port. This is not a java application. Rxtx enumerates the ports. It does this by opening the port if it is not locked and does a timed out read to see if the port is really there. It will either return some data, timeout or error (not there). Without using locks, rxtx opens ttyS3 mentioned above and messes up the pppd connection with its timed out read. This can never happen. The port really is not available to rxtx. There has been some discussion about implementing the functionality in rxtx to allow rxtx to ask other Java programs to release the port. The basic code is schetched in there and it is all Java code. But the reason this isnt being implemented right now is mainly a lack of interest. It wont solve the ppp issue mentioned above. There is also some interest to have rxtx be able to rescan the ports. I have been considering putting something like this in so you could say stop pppd and then rescan the ports. But the big thing I look for is 'what happens to pppd' if we change X. Maybe the easiest thing to do would be able to have the port enumerated if its locked then let the open fail with a message when someone tries to use it. >> On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: >> >>> Hi All, >>> On Fedora 2, when I open a port, things appear to work OK. >>> However, the second time I open a port I get: >>> RXTX fhs_lock() Error: creating lock file: /var/local/LCK...ttyS0: File >>> exists >>> Experimental: JNI_OnLoad called. >>> I am using: >>> RXTX-2.1-7pre20 >>> >>> This was working fine under mac osx.... >>> >> >> Did you close the port in between the opens? If you are opening the port >> twice without closing, thats an error and why rxtx is checking lockfiles.? >> Imagine two threads/applications reading the same port and only getting >> 1/2 the data each. >> >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > From lavelle at cs.umn.edu Tue Jun 7 15:03:09 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 07 Jun 2005 16:03:09 -0500 Subject: [Rxtx] Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> Message-ID: <42A60B8D.8080500@cs.umn.edu> Hello, I'm trying to use 2.0-7pre1 at a baudrate of 250000 to communicate with a virtual comport. This isn't so much of a problem, what is, however, is that the comport is only ever set to 9600 baud. I've not found this as a documented bug, has anyone else encountered anything similar? I'll try and provide more detail tomorrow, but if anyone has any suggestions or encountered this before, I'd like to hear about it. Thanks in advance, ~ Shawn Lavelle From lavelle at cs.umn.edu Tue Jun 14 16:59:54 2005 From: lavelle at cs.umn.edu (Shawn Lavelle) Date: Tue, 14 Jun 2005 17:59:54 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <42AF4D1A.90202@atcorp.com> <42AF56B8.1000305@atcorp.com> Message-ID: <42AF616A.1000809@cs.umn.edu> Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up as a > tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know you > can reassign ports in XP. RXTX scans up through COM255. You may try > moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if thats > in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on what > may be considered normal comm port operations such as setting the speed, > timeout, threshold, .. One would have to start looking at each function > called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware managers, >>It shows up as COM3 in windows and USB bus 2, device 3 in linux. I >>can't seem to get it to show up as a tty(s#) in linux which is probably >>just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated via >>>>CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial convertor >>>>with a driver that has it show up as a virtual comport. I can enter >>>>this port manually and it will be usable but I cannot get it show up >>>>automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are trying to >>>open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From francisco.guimaraes at newpos.com Wed Jun 15 10:48:57 2005 From: francisco.guimaraes at newpos.com (Francisco Areas Guimaraes) Date: Wed, 15 Jun 2005 13:48:57 -0300 Subject: [Rxtx] Clearing Input Message-ID: <42B05BF9.1080605@newpos.com> Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco -------------- next part -------------- A non-text attachment was scrubbed... Name: francisco.guimaraes.vcf Type: text/x-vcard Size: 319 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050615/0d672c13/francisco.guimaraes-0008.vcf From d.tonhofer at m-plify.com Fri Jun 17 13:33:41 2005 From: d.tonhofer at m-plify.com (David Tonhofer, m-plify S.A.) Date: Fri, 17 Jun 2005 21:33:41 +0200 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> That looks weird. After that change, you are using the javax.comm.CommDriver instead of gnu.io.CommDriver. =:-o And things still work? If your RXTXcomm.jar is in $JAVA_HOME/jre/lib/ext/RXTXcomm.jar everything should work just fine. There is nothing particular in Tiger regarding classpaths. Best, -- David --On Friday, June 17, 2005 11:57 AM -0700 Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > > Thanks > > D. > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert? L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 From lyon at docjava.com Fri Jun 17 13:38:58 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Fri, 17 Jun 2005 15:38:58 -0400 Subject: [Rxtx] the webstart version of rxtx Message-ID: Hi All, I am working on a web start version of rxtx. The linux part looks like this: Where: gnu.jar is a signed Jar with all the GNU stuff for RXTX and linuxNative.jar has: librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so librxtxI2C.lai librxtxRS485.lai librxtxI2C.so librxtxRS485.so librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so librxtxParallel.lai librxtxSerial.lai librxtxParallel.so librxtxSerial.so librxtxRaw-2.1-7pre20.so linuxNative.jar librxtxRaw.lai META-INF/ librxtxRaw.so In it (and is also signed). When I run the application, I get: java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver The goal is to download the RXTX into the JAVAWS runtime (rather than install it into the JRE). This make updates rather more automatic, and independent of needing an SU (although the lock problem probably persists, since javaws is not in the right group). I think this might have something to do with the symbolic links that I saw floating around in the .libs directory. My guess is that I need to remove links from librxtxRaw.so to librxtxRaw-2.1-7pre20.so because they don't deploy well in a native jar for javaws. My thinking is that symbolic links confuse the native class loader. On the other hand, the class not found exception seems like a different problem. Any ideas what I might be doing wrong? Thanks! - Doug From taj at www.linux.org.uk Fri Jun 17 13:55:30 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 17 Jun 2005 20:55:30 +0100 (BST) Subject: [Rxtx] the webstart version of rxtx In-Reply-To: References: Message-ID: On Fri, 17 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I am working on a web start version of rxtx. > > The linux part looks like this: > > > > > > > Where: > gnu.jar is a signed Jar with all the GNU stuff for RXTX and > linuxNative.jar has: > librxtxI2C-2.1-7pre20.so librxtxRS485-2.1-7pre20.so > librxtxI2C.lai librxtxRS485.lai > librxtxI2C.so librxtxRS485.so > librxtxParallel-2.1-7pre20.so librxtxSerial-2.1-7pre20.so > librxtxParallel.lai librxtxSerial.lai > librxtxParallel.so librxtxSerial.so > librxtxRaw-2.1-7pre20.so linuxNative.jar > librxtxRaw.lai META-INF/ > librxtxRaw.so > > In it (and is also signed). > > When I run the application, I get: > java.lang.ClassNotFoundException: gnu.io.RXTXCommDriver thrown > while loading gnu.io.RXTXCommDriver > > The goal is to download the RXTX into the JAVAWS runtime (rather than > install it > into the JRE). This make updates rather more automatic, and independent of > needing an SU (although the lock problem probably persists, since > javaws is not in > the right group). > > I think this might have something to do with > the symbolic links that I saw floating around in the .libs directory. > > My guess is that I need to remove links from librxtxRaw.so to > librxtxRaw-2.1-7pre20.so > because they don't deploy well in a native jar for javaws. > > My thinking is that symbolic links confuse the native class loader. > > On the other hand, the class not found exception seems like a > different problem. > > Any ideas what I might be doing wrong? > I'm not familiar with the web start. I know the guys at ibutton (dalsemi) are doing something like that. You should be able to greatly reduce the size of your jar and web start by cutting out all RS485, Raw, and I2C files which are not used. They require minor changes to rxtx to even try loading so they are dead weight for your web start. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Fri Jun 17 14:11:50 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Fri, 17 Jun 2005 15:11:50 -0500 Subject: [Rxtx] Pending admin held messages comming In-Reply-To: References: Message-ID: <42B32E86.4010200@atcorp.com> Heh, I accidentally had sent some from the wrong email address, lavelle at cs... So, the stuff that seems like duplicates... is :-P Sorry about that! ~Shawn Trent Jarvi wrote: > I just realized the noticices for held emails are not being sent to me > after we moved to electronpushers.org. There will be ~5 messages comming. > From Christopher.Dawes at ants.me.uk Fri Jun 17 19:07:02 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:07:02 +0100 Subject: [Rxtx] Virtual Com Ports In-Reply-To: <42AF616A.1000809@cs.umn.edu> Message-ID: <200506180107.j5I171ch017598@outmail.freedom2surf.net> I'm afraid we're just using the latest version from the FTDI website. I've not yet played with linux properly with this and unfortunately I run gentoo and haven't yet successfully compiled in the ftdi driver. I'll let you know if I get any success. Appologies Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle Sent: 15 June 2005 00:00 To: Java RXTX discussion Subject: Re: [Rxtx] Virtual Com Ports Hmm, the latter sounds like a lot of work. It does find the virtual comport in windows, i must have just missed it earlier (sign of a long day). On the linux side, I suspect that something is not correct with the driver installation becuase it does not give me a tty for it :( Christopher, May I ask what driver you are using for your FTDI chip? Did you ever encounter problems with not getting a tty assigned for it? Thanks for all your help! ~ Shawn Trent Jarvi wrote: > They will have to show up as a tty device in Linux. Probably ttyUSB? > That will need an entry in RXTXCommDriver.java. If they dont show up > as a tty device, rxtx cant treat it like a serial port. It just wont work. > > With COM3, rxtx will try to open the port and perform a timed out read. > Usually if a port is not there, the read blows up or the open blows up. > Timing out is fine. COM3 used to share interrupts with COM1. I know > you can reassign ports in XP. RXTX scans up through COM255. You may > try moving it. > > > The code in question is the following in RXTXCommDriver.java > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > { > String[] Temp = { > "COM" // win32 serial ports > //"//./COM" // win32 serial ports > }; > CandidatePortPrefixes=Temp; > } > > If COM3 can be read, it should be found. the ttyUSB should work if > thats in the version of RXTXCommDriver.java you have. > > If this is still a problem, it may be that the driver is erroring on > what may be considered normal comm port operations such as setting the > speed, timeout, threshold, .. One would have to start looking at each > function called in the native open() and read(). > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>seems to find the device using rxtx. Looking at the hardware >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>linux. I can't seem to get it to show up as a tty(s#) in linux which >>is probably just due to my lack of significant linux knowledge. >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>Has anyone here noticed that virtual comports do not get enumerated >>>>via CommPortIdentifier.getPortIdentifiers()?? >>>> >>>>The device I'm trying to talk to uses an fdti usb to serial >>>>convertor with a driver that has it show up as a virtual comport. I >>>>can enter this port manually and it will be usable but I cannot get >>>>it show up automatically (as in the simple serial demo). Any thoughts on this? >>>> >>> >>> >>>Hi Shawn, >>> >>>What OS is this and what is the name of the virtual port you are >>>trying to open? I suspect the name just needs to be added to RXTXCommDriver.java. >>> >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From Christopher.Dawes at ants.me.uk Fri Jun 17 19:10:04 2005 From: Christopher.Dawes at ants.me.uk (christopher-dawes-ants-me-uk) Date: Sat, 18 Jun 2005 02:10:04 +0100 Subject: [Rxtx] Clearing Input In-Reply-To: <42B05BF9.1080605@newpos.com> Message-ID: <200506180110.j5I1A4ch018096@outmail.freedom2surf.net> Unfortunately I'd suggest that your protocol has a special character that sepperates messages from each other so you can then discard up til the start of message marker. We use a character 2 then the message then character three. Character 2's in the message are made to be character 4 then character 12. character 3's in the message are made to be character 4 then character 13. Character 4 is made to be character 4 then character 4. Hope this makes some kinda sense Christopher -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Francisco Areas Guimaraes Sent: 15 June 2005 17:49 To: rxtx at mail.electronpusher.org Subject: [Rxtx] Clearing Input Hi, I'm having the following problem: when I'm reading from the serial port, I get a lot of garbage thta was written. Is there anyway to clear the input before reading? I searched through the mail list archive, but didn't find anything conclusive. Any response is deeply appreciated. Thanks, Francisco From taj at www.linux.org.uk Fri Jun 17 19:29:45 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 02:29:45 +0100 (BST) Subject: [Rxtx] Virtual Com Ports In-Reply-To: <200506180107.j5I171ch017598@outmail.freedom2surf.net> References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: Just a note here. I have requested a FTDI usb device and they offered to send one for the purpose of trying to get rxtx working. I have no idea how long that takes though. On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > I'm afraid we're just using the latest version from the FTDI website. I've > not yet played with linux properly with this and unfortunately I run gentoo > and haven't yet successfully compiled in the ftdi driver. I'll let you know > if I get any success. > > Appologies > > Christopher > > -----Original Message----- > From: rxtx-bounces at mail.electronpusher.org > [mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle > Sent: 15 June 2005 00:00 > To: Java RXTX discussion > Subject: Re: [Rxtx] Virtual Com Ports > > Hmm, the latter sounds like a lot of work. It does find the virtual comport > in windows, i must have just missed it earlier (sign of a long day). On the > linux side, I suspect that something is not correct with the driver > installation becuase it does not give me a tty for it :( > > Christopher, May I ask what driver you are using for your FTDI chip? > Did you ever encounter problems with not getting a tty assigned for it? > > > Thanks for all your help! > > ~ Shawn > > Trent Jarvi wrote: > > They will have to show up as a tty device in Linux. Probably ttyUSB? > > That will need an entry in RXTXCommDriver.java. If they dont show up > > as a tty device, rxtx cant treat it like a serial port. It just wont > work. > > > > With COM3, rxtx will try to open the port and perform a timed out read. > > Usually if a port is not there, the read blows up or the open blows up. > > Timing out is fine. COM3 used to share interrupts with COM1. I know > > you can reassign ports in XP. RXTX scans up through COM255. You may > > try moving it. > > > > > > The code in question is the following in RXTXCommDriver.java > > > > > > if(osName.equals("Linux")) > > { > > String[] Temp = { > > "ttyS", // linux Serial Ports > > "ttySA", // for the IPAQs > > "ttyUSB" // for USB frobs > > }; > > CandidatePortPrefixes=Temp; > > } > > > > else if(osName.toLowerCase().indexOf("windows") != -1 ) > > { > > String[] Temp = { > > "COM" // win32 serial ports > > //"//./COM" // win32 serial ports > > }; > > CandidatePortPrefixes=Temp; > > } > > > > If COM3 can be read, it should be found. the ttyUSB should work if > > thats in the version of RXTXCommDriver.java you have. > > > > If this is still a problem, it may be that the driver is erroring on > > what may be considered normal comm port operations such as setting the > > speed, timeout, threshold, .. One would have to start looking at each > > function called in the native open() and read(). > > > > > > > > On Tue, 14 Jun 2005, Shawn Lavelle wrote: > > > > > >>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one > >>seems to find the device using rxtx. Looking at the hardware > >>managers, It shows up as COM3 in windows and USB bus 2, device 3 in > >>linux. I can't seem to get it to show up as a tty(s#) in linux which > >>is probably just due to my lack of significant linux knowledge. > >> > >> ~ Shawn > >> > >>Trent Jarvi wrote: > >> > >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: > >>> > >>> > >>> > >>>>Has anyone here noticed that virtual comports do not get enumerated > >>>>via CommPortIdentifier.getPortIdentifiers()?? > >>>> > >>>>The device I'm trying to talk to uses an fdti usb to serial > >>>>convertor with a driver that has it show up as a virtual comport. I > >>>>can enter this port manually and it will be usable but I cannot get > >>>>it show up automatically (as in the simple serial demo). Any thoughts > on this? > >>>> > >>> > >>> > >>>Hi Shawn, > >>> > >>>What OS is this and what is the name of the virtual port you are > >>>trying to open? I suspect the name just needs to be added to > RXTXCommDriver.java. > >>> > >> > >>_______________________________________________ > >>Rxtx mailing list > >>Rxtx at mail.electronpusher.org > >>http://www.electronpusher.org/mailman/listinfo/rxtx > >> > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Fri Jun 17 21:24:25 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Fri, 17 Jun 2005 20:24:25 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <8562E8BB4532F1AF5F10018D@[192.168.1.7]> References: <42B31D34.4070805@gmail.com> <8562E8BB4532F1AF5F10018D@[192.168.1.7]> Message-ID: <42B393E9.5000505@gmail.com> See comments inline: David Tonhofer, m-plify S.A. wrote: > That looks weird. After that change, you are using the > javax.comm.CommDriver > instead of gnu.io.CommDriver. =:-o Yup: import javax.comm.CommPortIdentifier; import javax.comm.NoSuchPortException; import javax.comm.PortInUseException; import javax.comm.SerialPort; import javax.comm.SerialPortEvent; import javax.comm.SerialPortEventListener; [...] public class Foo implements Bar, SerialPortEventListener { [...] > > And things still work? Correct. Once I recompile the 20050120 jar from the 20050120 source with the change in my original post, everything works. > > If your RXTXcomm.jar is in > > $JAVA_HOME/jre/lib/ext/RXTXcomm.jar That's where the jar is, both under Linux and Windows. > > everything should work just fine. There is nothing particular in Tiger > regarding > classpaths. That's my understanding too. Thanks for confirming I'm not hallucinating :-) Hmm... Looking at the exception message again: [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver while loading driver gnu.io.RXTXCommDriver The mention of a driver points to this exception being generated from inside Sun's comm.jar, instead of "really" in a classloader. This may mean that I've screwed up something in my comm.jar setup. However, javax.comm.properties looks OK to me: Driver=gnu.io.RXTXCommDriver SerialPorts=/dev/rfcomm4 and it's in $JAVA_HOME/jre/lib. I can't find source for Sun's comm.jar on their site, so I'm not sure how this exception is being created. The only other thing I can think of here is if the compiler used to build the 20050120 binary tarball somehow misbehaved... D. From taj at www.linux.org.uk Fri Jun 17 21:57:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 04:57:46 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B31D34.4070805@gmail.com> References: <42B31D34.4070805@gmail.com> Message-ID: On Fri, 17 Jun 2005, Dimitris Kogias wrote: > Hi, > > In both Windows XPSP1 and Linux, in both cases with JRE 1.5.0_03, > running rxtx 2.0-CVS-20050120 results in this: > > [java] Caught java.lang.NoClassDefFoundError: gnu/io/CommDriver > while loading driver gnu.io.RXTXCommDriver > > inside a NoSuchPortException. > > Making this change: > > --- RXTXCommDriver.java 9 Apr 2005 08:32:21 -0000 1.64 > +++ RXTXCommDriver.java 17 Jun 2005 18:55:18 -0000 > @@ -60,7 +60,7 @@ > /** > This is the JavaComm for Linux driver. > */ > -public class RXTXCommDriver implements CommDriver > +public class RXTXCommDriver implements javax.comm.CommDriver > { > > private final static boolean debug = false; > > on the 20050120 snapshot's code and substituting the jar fixes the > problem. The diff above is from CVS, but the implements clause is > identical in CVS and 20050120. > > Am I missing something obvious about classpath resolution or the 1.5 > javac here? > Strange. Is there an import in the file you are using? CommDriver is in javax.comm not rxtx 2.0 (make sure you are not mixing rxtx 2.0 and rxtx 2.1) rxtx 2.1 has its own CommDriver but is in package gnu.io. import javax.comm.*; That should be all thats needed. I suspected the import was incorrectly input gnu.io.*; but looking at the tarball, the sorce is correct. It may be that the binaries for Mac OS X are not in sync with the src. I dont have a Mac OS X yet for building those. Dimitry Markman has helped in the past with those. I could picture the import javax.comm accidently being import gnu.io when merging with rxtx 2.1 at some point and since then being corrected. Looking at the dates, I think the Mac OS X binaries are 5 months out of sync and do need to be rebuilt. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sat Jun 18 04:36:50 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sat, 18 Jun 2005 03:36:50 -0700 Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: References: <42B31D34.4070805@gmail.com> Message-ID: <42B3F942.7060409@gmail.com> > It may be that the binaries for Mac OS X are not in sync with the src. I > dont have a Mac OS X yet for building those. Dimitry Markman has helped > in the past with those. I could picture the import javax.comm accidently > being import gnu.io when merging with rxtx 2.1 at some point and since > then being corrected. > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > sync and do need to be rebuilt. > This isn't on MacOS X, it was on Linux and Windows with rxtx-2.0-CVS-20050120-bins. The implements clause change I sent was a red herring, sorry. I think the 20050120 bins tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is built wrong, referencing gnu.io.CommDriver instead of javax.comm.CommDriver. Here's the beginning of jad's output on RXTXCommDriver.class from RXTXcomm.jar in that tarball: // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: fullnames // Source File Name: RXTXCommDriver.java package gnu.io; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Properties; import java.util.StringTokenizer; // Referenced classes of package gnu.io: // RXTXPort, LPRPort, PortInUseException, CommDriver, // CommPortIdentifier, RXTXVersion, CommPort public class RXTXCommDriver implements gnu.io.CommDriver { [...] Rebuilding from the corresponding source tarball (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. Dimitris. From ricardo.trindade at emation.pt Sat Jun 18 10:00:09 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 17:00:09 +0100 Subject: [Rxtx] best release Message-ID: <42B44509.9050103@emation.pt> Hi, what is the "best" release so far ? I've seen someone talking about 2.1.17-pre20, but can't find it in the ftp server. where is it ? thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 10:25:49 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:25:49 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: <42B44509.9050103@emation.pt> References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > what is the "best" release so far ? I've seen someone talking about > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > Thats the CVS snapshot on the download page ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz We have a problem with the 2.0 snapshot builds so I'll be making new snapshots today. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 10:40:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 17:40:03 +0100 (BST) Subject: [Rxtx] NoClassDefFoundError: gnu/io/CommDriver with 2.0-CVS-20050120 In-Reply-To: <42B3F942.7060409@gmail.com> References: <42B31D34.4070805@gmail.com> <42B3F942.7060409@gmail.com> Message-ID: On Sat, 18 Jun 2005, Dimitris Kogias wrote: > > It may be that the binaries for Mac OS X are not in sync with the src. I > > dont have a Mac OS X yet for building those. Dimitry Markman has helped > > in the past with those. I could picture the import javax.comm accidently > > being import gnu.io when merging with rxtx 2.1 at some point and since > > then being corrected. > > > > Looking at the dates, I think the Mac OS X binaries are 5 months out of > > sync and do need to be rebuilt. > > > > This isn't on MacOS X, it was on Linux and Windows with > rxtx-2.0-CVS-20050120-bins. > > The implements clause change I sent was a red herring, sorry. > > I think the 20050120 bins tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz) is > built wrong, referencing gnu.io.CommDriver instead of > javax.comm.CommDriver. Here's the beginning of jad's output on > RXTXCommDriver.class from RXTXcomm.jar in that tarball: > > // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. > // Jad home page: http://www.geocities.com/kpdus/jad.html > // Decompiler options: fullnames > // Source File Name: RXTXCommDriver.java > > package gnu.io; > > import java.io.File; > import java.io.FileInputStream; > import java.io.PrintStream; > import java.util.Properties; > import java.util.StringTokenizer; > > // Referenced classes of package gnu.io: > // RXTXPort, LPRPort, PortInUseException, CommDriver, > // CommPortIdentifier, RXTXVersion, CommPort > > public class RXTXCommDriver > implements gnu.io.CommDriver > { > > [...] > > Rebuilding from the corresponding source tarball > (ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz) fixes this. > OK. I'll see that this is fixed and I'll release a new snapshot today. Strange. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sat Jun 18 13:50:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 20:50:58 +0100 (BST) Subject: [Rxtx] best release In-Reply-To: References: <42B44509.9050103@emation.pt> Message-ID: On Sat, 18 Jun 2005, Trent Jarvi wrote: > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > Hi, > > > > what is the "best" release so far ? I've seen someone talking about > > 2.1.17-pre20, but can't find it in the ftp server. where is it ? > > > > Thats the CVS snapshot on the download page > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120.tar.gz > > We have a problem with the 2.0 snapshot builds so I'll be making new > snapshots today. > > I just noticed I pasted the wrong link for rxtx 2.1 ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz That does not have the problem we will be fixing today in 2.0... -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 14:37:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 21:37:53 +0100 Subject: [Rxtx] via eden Message-ID: <42B48621.2040505@emation.pt> Hi, I'm having a bit of trouble making rxtx work with a machine based on a via eden CPU. While I know the code and config work because I've tried them in a cyrix based CPU and in a regular laptop, they don't in the eden, with errors like "parity missed 3" I know the eden is x86 compatible, but the .so for rxtx is built for 686, could this be the problem ? usually x86 means 386... can this be the problem ? I tried to build rxtx for "pentium" and "x86", but the .so produced is exactly the same... I'm a bit confused... thanks Ricardo From taj at www.linux.org.uk Sat Jun 18 15:52:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 18 Jun 2005 22:52:16 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B48621.2040505@emation.pt> References: <42B48621.2040505@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > I'm having a bit of trouble making rxtx work with a machine based on > a via eden CPU. > > While I know the code and config work because I've tried them in a > cyrix based CPU and in a regular laptop, they don't in the eden, with > errors like "parity missed 3" > > I know the eden is x86 compatible, but the .so for rxtx is built for > 686, could this be the problem ? usually x86 means 386... > > can this be the problem ? I tried to build rxtx for "pentium" and > "x86", but the .so produced is exactly the same... > > I'm a bit confused... > I'm not even sure what OS you are using :) But this link may help you set the compile flags right. http://radagast.bglug.ca/epia/epia_howto/index.html#VIA_EPIA_CPUs -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sat Jun 18 16:40:48 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 18 Jun 2005 23:40:48 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> Message-ID: <42B4A2F0.4000404@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050618/e58f64c6/attachment-0008.html From taj at www.linux.org.uk Sat Jun 18 17:05:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 00:05:53 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B4A2F0.4000404@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: On Sat, 18 Jun 2005, Ricardo Trindade wrote: > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > _P_arity missed would ring a bell. I assume you just didnt copy the message correctly. Sounds like you are trying to set Mark Parity but when you compiled the library CMSPAR was not defined in your header files. If the system is glibc based, try putting this in the top of SerialImp.c. If it works its just buggy include files on your system I suspect. If peeweelinux is busybox based, I guess you would have to figure out whats wrong with their libc (why they dont define CMSPAR). #define CMSPAR 010000000000 Mark and Space parity will not work if those are not defined in the system include files. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Sun Jun 19 05:40:05 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 19 Jun 2005 12:40:05 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> Message-ID: <42B55995.3060509@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050619/d9dd12c7/attachment-0008.html From taj at www.linux.org.uk Sun Jun 19 11:40:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 18:40:13 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: <42B55995.3060509@emation.pt> References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I am not sure if the binaries I distribute are doing mark and space. I got some changes into glibc that fix their headers around then and assume those will solve this problem on linux in the long run. Your comments about exact same binaries behaving different on different machines dont make sense when you look at the code. It really is not possible. int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) { ENTER( "translate_parity" ); #ifdef CMSPAR (*cflag) &= ~(PARENB | PARODD | CMSPAR ); #endif /* CMSPAR */ switch( parity ) { case JPARITY_NONE: LEAVE( "translate_parity" ); return 0; case JPARITY_EVEN: (*cflag) |= PARENB; LEAVE( "translate_parity" ); return 0; case JPARITY_ODD: (*cflag) |= PARENB | PARODD; LEAVE( "translate_parity" ); return 0; #ifdef CMSPAR case JPARITY_MARK: (*cflag) |= PARENB | PARODD | CMSPAR; LEAVE( "translate_parity" ); return 0; case JPARITY_SPACE: (*cflag) |= PARENB | CMSPAR; LEAVE( "translate_parity" ); return 0; #endif /* CMSPAR */ default: printf("Parity missed %i\n", (int) parity ); } LEAVE( "translate_parity" ); ifdefs are compile time options. So that code is either there or not in your binary. No inbetween or sort of only when used on via. You may start looking to see if you dont have more libraries than you thought installed. You can always test the ifdefs at comile time like this: #ifdef CMSPAR #error CMSPAR is defined #endif /* CMSPAR */ On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > ??? I am in fact using mark and space, but the very same .so that fails > on this machine works on another machine, with the same OS image and same > application. > > ??? Do the .so that you distribute support mark and space ? > > thanks > Ricardo > > > Trent Jarvi wrote: > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > Hi, > > ??? I'm running peeweelinux, which is based on rh 6.1. > ??? > ??? All other aspects of my system work, and actually a deployment of the > same software that doesn't use a serial port has been successfull in > production for more than 6 months. So I'm not sure what to do... > > ??? Does "parity missed 3" ring a bell ? > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > message correctly. > > Sounds like you are trying to set Mark Parity but when you compiled the > library CMSPAR was not defined in your header files. > > If the system is glibc based, try putting this in the top of SerialImp.c. > If it works its just buggy include files on your system I suspect. If > peeweelinux is busybox based, I guess you would have to figure out whats > wrong with their libc (why they dont define CMSPAR). > > #define CMSPAR 010000000000 > > Mark and Space parity will not work if those are not defined in the system > include files. > > > > > > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Sun Jun 19 15:05:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 19 Jun 2005 22:05:28 +0100 (BST) Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: I wanted to include these links but was short on time. Here are the links for the glibc fixes I sent in You can easily look at your headers and see if the fix is on your system now. RedHat https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 Glibc in general. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html I last rebuilt rxtx-2.1-CVS in April so that should have the fixes but it really depends on what was in glibc at that time. If your distro does not have these fixes, it is a bug and should be filed with them. On Sun, 19 Jun 2005, Trent Jarvi wrote: > > I am not sure if the binaries I distribute are doing mark and space. I > got some changes into glibc that fix their headers around then and assume > those will solve this problem on linux in the long run. > > Your comments about exact same binaries behaving different on different > machines dont make sense when you look at the code. It really is not > possible. > > > int translate_parity( JNIEnv *env, tcflag_t *cflag, jint parity ) > { > ENTER( "translate_parity" ); > #ifdef CMSPAR > (*cflag) &= ~(PARENB | PARODD | CMSPAR ); > #endif /* CMSPAR */ > switch( parity ) { > case JPARITY_NONE: > LEAVE( "translate_parity" ); > return 0; > case JPARITY_EVEN: > (*cflag) |= PARENB; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_ODD: > (*cflag) |= PARENB | PARODD; > LEAVE( "translate_parity" ); > return 0; > #ifdef CMSPAR > case JPARITY_MARK: > (*cflag) |= PARENB | PARODD | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > case JPARITY_SPACE: > (*cflag) |= PARENB | CMSPAR; > LEAVE( "translate_parity" ); > return 0; > #endif /* CMSPAR */ > default: > printf("Parity missed %i\n", (int) parity ); > } > > LEAVE( "translate_parity" ); > > > > > ifdefs are compile time options. So that code is either there or not in > your binary. No inbetween or sort of only when used on via. You may > start looking to see if you dont have more libraries than you thought > installed. > > You can always test the ifdefs at comile time like this: > > #ifdef CMSPAR > #error CMSPAR is defined > #endif /* CMSPAR */ > > > On Sun, 19 Jun 2005, Ricardo Trindade wrote: > > > > > ??? I am in fact using mark and space, but the very same .so that fails > > on this machine works on another machine, with the same OS image and same > > application. > > > > ??? Do the .so that you distribute support mark and space ? > > > > thanks > > Ricardo > > > > > > Trent Jarvi wrote: > > > > On Sat, 18 Jun 2005, Ricardo Trindade wrote: > > > > > > > > Hi, > > > > ??? I'm running peeweelinux, which is based on rh 6.1. > > ??? > > ??? All other aspects of my system work, and actually a deployment of the > > same software that doesn't use a serial port has been successfull in > > production for more than 6 months. So I'm not sure what to do... > > > > ??? Does "parity missed 3" ring a bell ? > > > > > > > > _P_arity missed would ring a bell. I assume you just didnt copy the > > message correctly. > > > > Sounds like you are trying to set Mark Parity but when you compiled the > > library CMSPAR was not defined in your header files. > > > > If the system is glibc based, try putting this in the top of SerialImp.c. > > If it works its just buggy include files on your system I suspect. If > > peeweelinux is busybox based, I guess you would have to figure out whats > > wrong with their libc (why they dont define CMSPAR). > > > > #define CMSPAR 010000000000 > > > > Mark and Space parity will not work if those are not defined in the system > > include files. > > > > > > > > > > > > > > -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Mon Jun 20 01:04:40 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 20 Jun 2005 08:04:40 +0100 Subject: [Rxtx] via eden In-Reply-To: References: <42B48621.2040505@emation.pt> <42B4A2F0.4000404@emation.pt> <42B55995.3060509@emation.pt> Message-ID: <42B66A88.4060806@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050620/9be208a1/attachment-0008.html From fbalzarro at libero.it Mon Jun 20 02:33:52 2005 From: fbalzarro at libero.it (Fabio Balzarro) Date: Mon, 20 Jun 2005 10:33:52 +0200 Subject: [Rxtx] RXTXPort:close detected bad file descriptor Message-ID: I'm using RXTX libraries on IPAQ 4150 PDA with Windows CE 4.20 and Jeode. When I close a serial port with sp.close() (where sp is a SerialPort) sometimes an error occour 1119256168085: RXTXPort:close detected bad file descriptor What can I do? Thanks Fabio ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From slavelle at atcorp.com Mon Jun 20 08:08:19 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 20 Jun 2005 09:08:19 -0500 Subject: [Rxtx] Virtual Com Ports In-Reply-To: References: <200506180107.j5I171ch017598@outmail.freedom2surf.net> Message-ID: <42B6CDD3.4040409@atcorp.com> It turns out that I did have a driver-not-used issue which has now been resolved and I can use RxTx on it (had to add ttyUSB as a valid port), but only at standard baud rates. Does USB have the same restrictions on port speed as regular RS232? ~ Shawn Trent Jarvi wrote: > Just a note here. > > I have requested a FTDI usb device and they offered to send one for the > purpose of trying to get rxtx working. I have no idea how long that takes > though. > > > On Sat, 18 Jun 2005, christopher-dawes-ants-me-uk wrote: > > >>I'm afraid we're just using the latest version from the FTDI website. I've >>not yet played with linux properly with this and unfortunately I run gentoo >>and haven't yet successfully compiled in the ftdi driver. I'll let you know >>if I get any success. >> >>Appologies >> >>Christopher >> >>-----Original Message----- >>From: rxtx-bounces at mail.electronpusher.org >>[mailto:rxtx-bounces at mail.electronpusher.org] On Behalf Of Shawn Lavelle >>Sent: 15 June 2005 00:00 >>To: Java RXTX discussion >>Subject: Re: [Rxtx] Virtual Com Ports >> >>Hmm, the latter sounds like a lot of work. It does find the virtual comport >>in windows, i must have just missed it earlier (sign of a long day). On the >>linux side, I suspect that something is not correct with the driver >>installation becuase it does not give me a tty for it :( >> >>Christopher, May I ask what driver you are using for your FTDI chip? >>Did you ever encounter problems with not getting a tty assigned for it? >> >> >> Thanks for all your help! >> >> ~ Shawn >> >>Trent Jarvi wrote: >> >>>They will have to show up as a tty device in Linux. Probably ttyUSB? >>>That will need an entry in RXTXCommDriver.java. If they dont show up >>>as a tty device, rxtx cant treat it like a serial port. It just wont >> >>work. >> >>>With COM3, rxtx will try to open the port and perform a timed out read. >>>Usually if a port is not there, the read blows up or the open blows up. >>>Timing out is fine. COM3 used to share interrupts with COM1. I know >>>you can reassign ports in XP. RXTX scans up through COM255. You may >>>try moving it. >>> >>> >>>The code in question is the following in RXTXCommDriver.java >>> >>> >>> if(osName.equals("Linux")) >>> { >>> String[] Temp = { >>> "ttyS", // linux Serial Ports >>> "ttySA", // for the IPAQs >>> "ttyUSB" // for USB frobs >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>> else if(osName.toLowerCase().indexOf("windows") != -1 ) >>> { >>> String[] Temp = { >>> "COM" // win32 serial ports >>> //"//./COM" // win32 serial ports >>> }; >>> CandidatePortPrefixes=Temp; >>> } >>> >>>If COM3 can be read, it should be found. the ttyUSB should work if >>>thats in the version of RXTXCommDriver.java you have. >>> >>>If this is still a problem, it may be that the driver is erroring on >>>what may be considered normal comm port operations such as setting the >>>speed, timeout, threshold, .. One would have to start looking at each >>>function called in the native open() and read(). >>> >>> >>> >>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>> >>> >>> >>>>I'm running in winXP SP2 and linux mandrake 2.6 kernel. Neither one >>>>seems to find the device using rxtx. Looking at the hardware >>>>managers, It shows up as COM3 in windows and USB bus 2, device 3 in >>>>linux. I can't seem to get it to show up as a tty(s#) in linux which >>>>is probably just due to my lack of significant linux knowledge. >>>> >>>> ~ Shawn >>>> >>>>Trent Jarvi wrote: >>>> >>>> >>>>>On Tue, 14 Jun 2005, Shawn Lavelle wrote: >>>>> >>>>> >>>>> >>>>> >>>>>>Has anyone here noticed that virtual comports do not get enumerated >>>>>>via CommPortIdentifier.getPortIdentifiers()?? >>>>>> >>>>>>The device I'm trying to talk to uses an fdti usb to serial >>>>>>convertor with a driver that has it show up as a virtual comport. I >>>>>>can enter this port manually and it will be usable but I cannot get >>>>>>it show up automatically (as in the simple serial demo). Any thoughts >> >>on this? >> >>>>> >>>>>Hi Shawn, >>>>> >>>>>What OS is this and what is the name of the virtual port you are >>>>>trying to open? I suspect the name just needs to be added to >> >>RXTXCommDriver.java. >> >>>>_______________________________________________ >>>>Rxtx mailing list >>>>Rxtx at mail.electronpusher.org >>>>http://www.electronpusher.org/mailman/listinfo/rxtx >>>> >>> >>> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> >>_______________________________________________ >>Rxtx mailing list >>Rxtx at mail.electronpusher.org >>http://www.electronpusher.org/mailman/listinfo/rxtx >> > > From lyon at docjava.com Mon Jun 20 15:06:08 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 20 Jun 2005 17:06:08 -0400 Subject: [Rxtx] testing Message-ID: Hi All, I am testing my new multi-platform Java Webstart RXTX application (Trent: I could not have done it without you!). So far, I think it will work under Linux (x86), Windows XP, Windows 2000 and MacOS X. The application is available as a Java webstart application at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Edit:Preferences: SerialPort Setup... should bring up a dialog box that enables dialing via the modem. Generally, it does not find internal modems (except on the mac). Why, I don't know. Thanks in advance for trying this new app. All feedback on it is welcome. - Doug Lyon From jasmine at electronpusher.org Tue Jun 21 04:15:53 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Tue, 21 Jun 2005 11:15:53 +0100 Subject: [Rxtx] testing In-Reply-To: References: Message-ID: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > Hi All, > I am testing my new multi-platform Java Webstart RXTX application > (Trent: I could not have done it without you!). > > So far, I think it will work under Linux (x86), Windows XP, > Windows 2000 and MacOS X. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. -J. From taj at www.linux.org.uk Tue Jun 21 05:50:23 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 12:50:23 +0100 (BST) Subject: [Rxtx] testing In-Reply-To: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> References: <5df3818e3f486709c623cbc72bc99a12@electronpusher.org> Message-ID: On Tue, 21 Jun 2005, Jasmine Strong wrote: > > On 20 Jun 2005, at 22:06, Dr. Douglas Lyon wrote: > > > Hi All, > > I am testing my new multi-platform Java Webstart RXTX application > > (Trent: I could not have done it without you!). > > > > So far, I think it will work under Linux (x86), Windows XP, > > Windows 2000 and MacOS X. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > on my Mac. > passing -source 1.3 -target 1.3 to javac will compile classes without this problem. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 10:19:25 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 11:19:25 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. Sincerely, Jeremyah Payne From ricardo.trindade at emation.pt Tue Jun 21 13:25:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 20:25:00 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B8698C.2060509@emation.pt> Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > From taj at www.linux.org.uk Tue Jun 21 13:39:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:39:43 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <42B8698C.2060509@emation.pt> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> <42B8698C.2060509@emation.pt> Message-ID: It looks like he has an rs422 device/converter. This is not the problematic 'trying to do protocol X with a serial port' situation unless I'm missing something. I'll follow up with the other email I started. On Tue, 21 Jun 2005, Ricardo Trindade wrote: > Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. > > Payne, Jeremyah L (N-CIM) wrote: > > >Good morning, my name is Jeremyah and I am working on a java project to > >interface with some devices. In short, I have a laptop with a PCMIA > >converter that does RS422 running windows 2000. I also will be > >installing some PCI cards into some Linux boxes that will have probably > >4-8 RS422 ports on them. After doing some reading in order to talk > >with these items using my existing java code I will need an additional > >driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > >trying to get a map sort of where I need to make changes. As I see it, > >I would need to subclass SerialPort to my RS422 interface. That would > >link with a DLL or SO implementation that talks with the hardware. I > >also need to change the listing of working ports in the lookup section > >for serial. Does this seem like I am on the right track? Appreciate > >the support. > > > > > >Sincerely, > >Jeremyah Payne > >_______________________________________________ > >Rxtx mailing list > >Rxtx at mail.electronpusher.org > >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 21 13:40:25 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 21 Jun 2005 20:40:25 +0100 (BST) Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: On Tue, 21 Jun 2005, Payne, Jeremyah L (N-CIM) wrote: > Good morning, my name is Jeremyah and I am working on a java project to > interface with some devices. In short, I have a laptop with a PCMIA > converter that does RS422 running windows 2000. I also will be > installing some PCI cards into some Linux boxes that will have probably > 4-8 RS422 ports on them. After doing some reading in order to talk with > these items using my existing java code I will need an additional > driver, like RXTXSerial.so except rxtxRS422.so As of right now I am > trying to get a map sort of where I need to make changes. As I see it, I > would need to subclass SerialPort to my RS422 interface. That would link > with a DLL or SO implementation that talks with the hardware. I also > need to change the listing of working ports in the lookup section for > serial. Does this seem like I am on the right track? Appreciate the > support. > Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org From jeremyah.l.payne at lmco.com Tue Jun 21 13:40:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 14:40:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618954@emss02m08.us.lmco.com> I'd like to except I am dealing with NASA. I am basically building a system to monitor 100+ Units that communicate over RS422. They have some converters in place but want to get rid of them. I'll check through the archives. I had started looking yesterday as was leaving work. -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Ricardo Trindade Sent: Tuesday, June 21, 2005 2:25 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 Don't do it. Buy a 232-422 adapter. Dont ask why :) Check the archives. Payne, Jeremyah L (N-CIM) wrote: >Good morning, my name is Jeremyah and I am working on a java project to interface with some devices. In short, I have a laptop with a PCMIA converter that does RS422 running windows 2000. I also will be installing some PCI cards into some Linux boxes that will have probably 4-8 RS422 ports on them. After doing some reading in order to talk with these items using my existing java code I will need an additional driver, like RXTXSerial.so except rxtxRS422.so As of right now I am trying to get a map sort of where I need to make changes. As I see it, I would need to subclass SerialPort to my RS422 interface. That would link with a DLL or SO implementation that talks with the hardware. I also need to change the listing of working ports in the lookup section for serial. Does this seem like I am on the right track? Appreciate the support. > > >Sincerely, >Jeremyah Payne >_______________________________________________ >Rxtx mailing list >Rxtx at mail.electronpusher.org >http://www.electronpusher.org/mailman/listinfo/rxtx > > > > > _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From slavelle at atcorp.com Tue Jun 21 14:58:06 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 21 Jun 2005 15:58:06 -0500 Subject: [Rxtx] Re: Setting BaudRate not functioning In-Reply-To: References: <20050607180632.1543A29D5C8@mail.electronpusher.org> <42A60B8D.8080500@cs.umn.edu> <42A735E3.8040706@atcorp.com> Message-ID: <42B87F5E.4000403@atcorp.com> > Linux has the standard POSIX like baud rates but if you set the baud rate > to B38400, you can set your own baud base and divisor. This is not POSIX > that I know of. W32 has more capability than POSIX like systems too. So > I did some work to have windows work like Linux via termios.c > > But the code is not quit right. SerialImp.c and termios.c need some > work so all the various buadrates work on Linux and W32. Most other > systems will not work beyond what CommAPI already specifies without > writting kernel drivers. > > This is on my todo list but if someone gets to it first, all the better. Hmm, I guess I didn't read this close enough before. Just to be clear, the pieces to setBaudBase and setDivisor are not yet implemented, correct? Thanks, Shawn From sean_montgomery at baseview.com Tue Jun 21 15:14:08 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 21 Jun 2005 17:14:08 -0400 Subject: [Rxtx] OS X installation - file locations Message-ID: <8AB82C7F-0D19-45F9-AE54-A12C59A8495E@baseview.com> Greetings, I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) using the RXTX installation instructions. RXTX worked fine. Basically you've got: - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions - javax.comm.properties in /System/Library/Frameworks/ JavaVM.framework/Home/lib - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ lib/ext My coworker was concerned that the installation required files to be placed in /System/Library... because those directories are "Apple's" and subject to change at Apple's whim, and that it would be safer (less likely to break when a user updates their OS or Java version or what have you) if all the files could be somewhere in /Library... or / Library/Java. My coworker points out that when 3rd party apps like FrontBase and JBoss need to communicate with Java their jars are placed in /Library/Java/Extensions. Granted that RXTX 2.0 is implementing javax.comm and not just a 3rd party extension, might that be the case - that javax.* stuff needs to be in the Java system files? I'm not the Java maven that my coworker is, so I don't know if any of this is gospel or not. Any OS X/Java experts out there willing to comment? We'd like to be able to install RXTX in the safest, most maintenance free way possible, but if there are specific reasons why javax.comm.properties and comm.jar need to be in /System... then so be it. Any information is welcome, Sean From ricardo.trindade at emation.pt Tue Jun 21 15:56:53 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 21 Jun 2005 22:56:53 +0100 Subject: [Rxtx] expanding RXTX to support RS422 In-Reply-To: References: <647990CCFD8D10488959542988C4588B618953@emss02m08.us.lmco.com> Message-ID: <42B88D25.7060604@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050621/f6c9f5fe/attachment-0008.html From jeremyah.l.payne at lmco.com Tue Jun 21 15:22:12 2005 From: jeremyah.l.payne at lmco.com (Payne, Jeremyah L (N-CIM)) Date: Tue, 21 Jun 2005 16:22:12 -0500 Subject: [Rxtx] expanding RXTX to support RS422 Message-ID: <647990CCFD8D10488959542988C4588B618955@emss02m08.us.lmco.com> -----Original Message----- From: rxtx-bounces at mail.electronpusher.org [mailto:rxtx-bounces at mail.electronpusher.org]On Behalf Of Trent Jarvi Sent: Tuesday, June 21, 2005 2:40 PM To: Java RXTX discussion Subject: Re: [Rxtx] expanding RXTX to support RS422 As of yet we have not decided on the PCI boards to use yet So I am still waiting to se how we will interface to them. But the laptop is ready to use so ill build a test app for that API for now. The overview of class structure is really what I needed. I guess I will use the 2.1 as you suggested. Thanks for the help thus far! BTW, you guys wouldn't happen to keep class diagrams or anything of that nature around would you? If not I will probably end up having to do some anyway for documentation purposes, I could include them. Hi Jeremyah Asuuming you have hardware that can do RS422 which it sounds like you do. Yes, that sounds about right. I'm not sure if you want to inherit from RXTXSerial.java or maybe just copy something over to RXTXRS422.java. RS485 my be easier to start from. Some hints to get you started, I can help more when you get a feel for things. You need to use rxtx 2.1. This is an extension to CommAPI and should not be in space javax.comm (rxtx 2.0). Preferably you will use CVS so it is easier to merge. After you get some files together, I can give you CVS access off the list. RXTXCommDriver.java This will need to enumerate ports like it currently does for CommPortIdentifier.PORT_SERIAL Without this, your class is never used. This class also needs list of devices to be enumerated. CommPortIdentifier.java This will need public static final int PORT_RS422 = 6; // RS422 Ports You can copy one of the classes over as a template for your work, maybe RS485. I'd start with creating your own copies of the following: RS422termios.c RS422win32termios.h RS422.java RS422Port.java RS422PortEvent.java RS422PortEventListener.java RS422Imp.c RS422Imp.h If the w32 layer does not need many changes, termios.c and win32termios.h may not need to be split. You may be able to inherit from RXTXPort.java and gang too. I'm not familiar with the API you have for the ports it is probably very simular. But to get things going, it may be easier to just fork copies for now and then look at how different they turn out. The RS232 Serial code may be a bit more complicated than you need for an initial port. The RS485 is a copy of the same code from more simple times and may be more attractive for a first port while looking at the RS232 code if something is missing. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at mail.electronpusher.org http://www.electronpusher.org/mailman/listinfo/rxtx From dmarkman at mac.com Tue Jun 21 18:13:28 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 21 Jun 2005 20:13:28 -0400 Subject: [Rxtx] OS X installation - file locations In-Reply-To: References: Message-ID: <044F520C-585C-4B99-82ED-3BA83DB8CE77@mac.com> Apple doesn't recommend to put jars into the /System/Library/Frameworks/JavaVM.framework/Home/lib/ext folder from other hands it's standard java directory to put extentions if you want to support comm api on whole system then I'd recommend to put jars into the /Library/Java/Extensions folder just like you did if you want to support comm api per user put your jars into the ~/ Library/Java/Extensions On Jun 21, 2005, at 5:14 PM, Java RXTX discussion wrote: > Greetings, > > > I was helping a coworker install RXTX 2.0-7pre2 on OS X (10.4.1) > using the RXTX installation instructions. RXTX worked fine. > > > Basically you've got: > - jcl.jar and librxtxSerial.jnilib in /Library/Java/Extensions > - javax.comm.properties in /System/Library/Frameworks/ > JavaVM.framework/Home/lib > - comm.jar in /System/Library/Frameworks/JavaVM.framework/Home/ > lib/ext > > > My coworker was concerned that the installation required files to be > placed in /System/Library... because those directories are "Apple's" > and subject to change at Apple's whim, and that it would be safer > (less likely to break when a user updates their OS or Java version or > what have you) if all the files could be somewhere in /Library... or / > Library/Java. My coworker points out that when 3rd party apps like > FrontBase and JBoss need to communicate with Java their jars are > placed in /Library/Java/Extensions. Granted that RXTX 2.0 is > implementing javax.comm and not just a 3rd party extension, might > that be the case - that javax.* stuff needs to be in the Java system > files? > > > I'm not the Java maven that my coworker is, so I don't know if any of > this is gospel or not. Any OS X/Java experts out there willing to > comment? We'd like to be able to install RXTX in the safest, most > maintenance free way possible, but if there are specific reasons why > javax.comm.properties and comm.jar need to be in /System... then so > be it. > > > Any information is welcome, > > > Sean > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > Dmitry Markman Dmitry Markman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050622/beea65d0/attachment-0008.html From lyon at docjava.com Thu Jun 23 04:39:47 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 23 Jun 2005 06:39:47 -0400 Subject: [Rxtx] web start + RXTX = strange errors? Message-ID: On: Date: Tue, 21 Jun 2005 11:15:53 +0100 From: Jasmine Strong Writes: An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) on my Mac. ----------- I cannot duplicate your error. My version of Java is: java -version java version "1.4.2_05" Is yours the same? Trent: You wrote: passing -source 1.3 -target 1.3 to javac will compile classes without this problem. ----------- OK, I have updated the disto to work with jdk1.3: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp Jasmine: Is this working any better? Thanks! - DL From handzisk at tkn.tu-berlin.de Fri Jun 24 02:37:14 2005 From: handzisk at tkn.tu-berlin.de (Vlado Handziski) Date: Fri, 24 Jun 2005 10:37:14 +0200 (CEST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace Message-ID: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Hi all, let me first express my compliments on the great work you have done with the RXTX library. We have been using the library for some time, and we are at a point where we want to make our code public. For legacy reasons, the code that the RXTX library is bundled with, uses the javax.comm namespace. We have been using the ChangePackage script to change the RXTX2.1 package from gnu.io into javax.comm. We need the independent implementation since we want to be able to directly access /dev/ttyUSBx ports in linux and the CommAPI versions are just not as stable. On the download page, there is a comment that this is in violation of sun's license. Can someone shed more light on this. I was not aware that you can protect the names of the java packages. Best regards, Vlado From ricardo.trindade at emation.pt Fri Jun 24 04:01:17 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 11:01:17 +0100 Subject: [Rxtx] parity missed Message-ID: <42BBD9ED.3060004@emation.pt> Hi, I have a "parity missed error". From previous posts I believe this has to do with CMSPAR not being defined. I checked out 2.1 head from CVS. How can I make sure I do a proper build and CMSPAR is defined ? Perhaps it would be good to have a release snapshot that has this, I think the latest snapshot (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. Another question I have, is why must this depend on kernel headers, why can't it be defined in the RXTX source ? thanks Ricardo From jasmine at electronpusher.org Fri Jun 24 04:09:06 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 24 Jun 2005 11:09:06 +0100 Subject: [Rxtx] web start + RXTX = strange errors? In-Reply-To: References: Message-ID: <644aad2bdbba950f0a2fb12d7dcfd8a6@electronpusher.org> On 23 Jun 2005, at 11:39, Dr. Douglas Lyon wrote: > OK, I have updated the disto to work with jdk1.3: > http://show.docjava.com:8086/book/cgij/code/jnlp/ > addbk.JAddressBook.Main.jnlp > > Jasmine: Is this working any better? Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) -J. From taj at www.linux.org.uk Fri Jun 24 10:54:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 17:54:12 +0100 (BST) Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: On Fri, 24 Jun 2005, Vlado Handziski wrote: > Hi all, > > let me first express my compliments on the great work you have done with > the RXTX library. > > We have been using the library for some time, and we are at a point where > we want to make our code public. For legacy reasons, the code that the > RXTX library is bundled with, uses the javax.comm namespace. We have been > using the ChangePackage script to change the RXTX2.1 package from gnu.io > into javax.comm. We need the independent implementation since we want to > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > versions are just not as stable. > > On the download page, there is a comment that this is in violation of > sun's license. Can someone shed more light on this. I was not aware that > you can protect the names of the java packages. > > Best regards, > Vlado > I can't provide legal advice as I am not a lawyer. (v) may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are contained in the "java", "javax" or "sun" packages or similar as specified by Sun in any class file naming convention; and The license is in the commapi package from Sun. The above is also in all the EULA's you click through to download from Sun if I'm not mistaken. Simply put, the license taints developers that agree to it. For those developers, Sun has control of the javax.comm namespace. It really does not make sense to put rxtx 2.1 in the javax.comm namespace. It will only cause confusion which I think is the point of the clause above. The gnu.io namespace was perhaps a poor choice and just tossed in when reviewing the license to get out of Sun's namespace. There is nothing in the rxtx license limiting your freedom in this fashion though. Many companies are moving to gnu.io and some distribute it with popular applications you would recognize. I'm tempted to ask you not to contaminate rxtx 2.1 with the javax.comm namespace. You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) extensions to existing classes (which I dont think you are using); it is not just javax.comm. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 24 13:24:09 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 24 Jun 2005 20:24:09 +0100 (BST) Subject: [Rxtx] parity missed In-Reply-To: <42BBD9ED.3060004@emation.pt> References: <42BBD9ED.3060004@emation.pt> Message-ID: On Fri, 24 Jun 2005, Ricardo Trindade wrote: > Hi, > > I have a "parity missed error". From previous posts I believe this > has to do with CMSPAR not being defined. > I checked out 2.1 head from CVS. How can I make sure I do a proper > build and CMSPAR is defined ? Perhaps it would be good to have a release > snapshot that has this, I think the latest snapshot > (rxtx-2.1-CVS-20050120-bins) doesn't work in regards to parity. > > Another question I have, is why must this depend on kernel headers, > why can't it be defined in the RXTX source ? > I used to cheat and grab the CMSPAR from the kernel headers because glibc did not have it. Now rxtx uses the glibc headers and we have a patch in glibc I trust that handles this. It would not be right to override glibc and it wasnt right to use the kernel headers (it really did cause problems). You can override glibc for now with the following in the top of SerialImp.c # define CMSPAR 010000000000 You can check if your distro headers have this right bit looking for the above in bits/termios.h. It should look like this: #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ # define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif If it is not defined, please file a bug with your distro as rxtx is not the only thing that will be broken on that distro. I was going to release new cvs snapshots last weekend but got tied up. I'll do it this weekend. I also need to get custom baudrate patches into the cvs snapshot. -- Trent Jarvi tjarvi at qbang.org From ricardo.trindade at emation.pt Fri Jun 24 13:56:50 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 24 Jun 2005 20:56:50 +0100 Subject: [Rxtx] parity missed In-Reply-To: References: <42BBD9ED.3060004@emation.pt> Message-ID: <42BC6582.2070805@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050624/e3b39631/attachment-0008.html From vlado.handziski at gmail.com Sat Jun 25 06:25:52 2005 From: vlado.handziski at gmail.com (Vlado Handziski) Date: Sat, 25 Jun 2005 14:25:52 +0200 Subject: [Rxtx] Licensing issues with using RXTX2.1 in the javax.comm namespace In-Reply-To: References: <49453.130.149.49.19.1119602234.squirrel@mail.tkn.tu-berlin.de> Message-ID: <697986ec05062505256ebf381f@mail.gmail.com> Thanks for the clarification. Since changing the bundled source is not an option at this moment, we will consider using javax.comm and RXTX2.0. In the next rewrite, we would probably move to gnu.io . Best regards, Vlado Handziski On 6/24/05, Trent Jarvi wrote: > > On Fri, 24 Jun 2005, Vlado Handziski wrote: > > > Hi all, > > > > let me first express my compliments on the great work you have done with > > the RXTX library. > > > > We have been using the library for some time, and we are at a point > where > > we want to make our code public. For legacy reasons, the code that the > > RXTX library is bundled with, uses the javax.comm namespace. We have > been > > using the ChangePackage script to change the RXTX2.1 package from gnu.io > > into javax.comm. We need the independent implementation since we want to > > be able to directly access /dev/ttyUSBx ports in linux and the CommAPI > > versions are just not as stable. > > > > On the download page, there is a comment that this is in violation of > > sun's license. Can someone shed more light on this. I was not aware that > > you can protect the names of the java packages. > > > > Best regards, > > Vlado > > > > I can't provide legal advice as I am not a lawyer. > > (v) may not create, or authorize your licensees to create additional > classes, interfaces, or subpackages that are contained in the "java", > "javax" or "sun" packages or similar as specified by Sun in any class file > naming convention; and > > The license is in the commapi package from Sun. The above is also in all > the EULA's you click through to download from Sun if I'm not mistaken. > > Simply put, the license taints developers that agree to it. For those > developers, Sun has control of the javax.comm namespace. > > It really does not make sense to put rxtx 2.1 in the javax.comm namespace. > It will only cause confusion which I think is the point of the clause > above. The gnu.io namespace was perhaps a poor choice and > just tossed in > when reviewing the license to get out of Sun's namespace. > > There is nothing in the rxtx license limiting your freedom in this fashion > though. Many companies are moving to gnu.io and some > distribute it with > popular applications you would recognize. I'm tempted to ask you not > to contaminate rxtx 2.1 with the javax.comm namespace. > > You can certainly do /dev/ttyUSBx with rxtx 2.0 and stay in javax.comm > using Sun's package. rxtx 2.1 adds new classes and (clearly labeled) > extensions to existing classes (which I dont think you are using); it is > not just javax.comm. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050625/1dadc50e/attachment-0008.html From taj at www.linux.org.uk Sun Jun 26 11:34:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 26 Jun 2005 18:34:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. Message-ID: The attached file should fix baud_base and divisor extensions for Linux The patch is against rxtx 2.1 CVS HEAD. To use this patch, you should set the baud rate to 38400. You can then try SerialPort.setBaudBase(int) and SerialPort.setDivisor(int) There are matching int SerialPort.getBaudBase() and int SerialPort.getDivisor(). What baud bases are available depends upon the serial port card and its driver so this is a bit of a blind attempt on my part. I've looked at the w32 API and I dont see anything available yet. The w32 code in RXTX will probably be figuring out the baud rate based on the tried baud base and divisor and just slamming it at the API for now (the API does something with that but I've not found real documentation on what it does). I dont want to try tinkering with the UART directly yet as that would involve poking machine memory directly and could very easily be error prone in bad ways. I don't expect Solaris or any SysV UNIX systems to work at all with this - ever. It is not standard in any way and will throw Exceptions on everything but Linux (w32 will just fail miserably as it is 1/2 implemented). If anyone has looked at custom baud rates before and has some thoughts or just wants to try the attached untested patch, I'd appreciate any feedback. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- ? autom4te.cache ? build ? output cvs server: Diffing . Index: configure =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure,v retrieving revision 1.35.2.59 diff -u -r1.35.2.59 configure --- configure 16 Oct 2004 16:20:34 -0000 1.35.2.59 +++ configure 26 Jun 2005 16:59:28 -0000 @@ -9644,6 +9644,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { #if defined (__GLIBC__) @@ -9782,6 +9784,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv) { @@ -9825,7 +9829,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -9837,7 +9841,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" Index: configure.in =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/configure.in,v retrieving revision 1.35.2.66 diff -u -r1.35.2.66 configure.in --- configure.in 16 Oct 2004 16:20:35 -0000 1.35.2.66 +++ configure.in 26 Jun 2005 16:59:28 -0000 @@ -218,6 +218,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { #if defined (__GLIBC__) @@ -356,6 +358,8 @@ cat > conftest.c << EOF #include +#include +#include int main(int argc, char *argv[]) { @@ -399,7 +403,7 @@ Tran*) find_java_native_include jni.h JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" CFLAGS=$CFLAGS" -D_BSD_SOURCE" @@ -411,7 +415,7 @@ *) find_java_native_include jni_md.h JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" - JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O" + JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" JAR="\$(JPATH)/bin/jar" JAVADOC="\$(JPATH)/bin/javadoc" CFLAGS=$CFLAGS" -D_BSD_SOURCE" cvs server: Diffing CNI cvs server: Diffing MACOSX_IDE cvs server: Diffing MACOSX_IDE/CW cvs server: Diffing MACOSX_IDE/ForPackageMaker cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java cvs server: Diffing MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions cvs server: Diffing MACOSX_IDE/ForPackageMaker/Resources cvs server: Diffing MACOSX_IDE/PB cvs server: Diffing WinCE cvs server: Diffing contrib cvs server: Diffing debian cvs server: Diffing src Index: src/RXTXPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXPort.java,v retrieving revision 1.27.2.62 diff -u -r1.27.2.62 RXTXPort.java --- src/RXTXPort.java 10 Jun 2005 19:50:31 -0000 1.27.2.62 +++ src/RXTXPort.java 26 Jun 2005 16:59:29 -0000 @@ -2079,15 +2079,17 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int BaudBase The clock frequency divided by 16. Default * BaudBase is 115200. * @return boolean true on success - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:setBaudBase()"); @@ -2097,10 +2099,11 @@ /** * Extension to CommAPI * @return int BaudBase - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getBaudBase() throws UnsupportedCommOperationException + public int getBaudBase() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getBaudBase()"); @@ -2108,13 +2111,14 @@ } /** - * Extension to CommAPI + * Extension to CommAPI. Set Baud Base to 38600 on Linux and W32 + * before using. * @param int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ public boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException + throws UnsupportedCommOperationException, IOException { if ( debug ) z.reportln( "RXTXPort:setDivisor()"); @@ -2124,10 +2128,11 @@ /** * Extension to CommAPI * @returns int Divisor; - * @throws UnsupportedCommOperationException + * @throws UnsupportedCommOperationException, IOException */ - public int getDivisor() throws UnsupportedCommOperationException + public int getDivisor() throws UnsupportedCommOperationException, + IOException { if ( debug ) z.reportln( "RXTXPort:getDivisor()"); Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.183 diff -u -r1.46.2.183 SerialImp.c --- src/SerialImp.c 10 Jun 2005 19:50:31 -0000 1.46.2.183 +++ src/SerialImp.c 26 Jun 2005 16:59:30 -0000 @@ -1877,16 +1877,27 @@ int fd = get_java_var( env, jobj,"fd","I" ); struct serial_struct sstruct; + if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) + { + goto fail; + } + + sstruct.baud_base = (int) BaudBase; + if ( sstruct.baud_base < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetBaudBase", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetBaudBase", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1914,9 +1925,13 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) ( sstruct.baud_base ) ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetBaudBase", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetBaudBase", strerror( errno ) ); @@ -1950,19 +1965,23 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } if ( sstruct.custom_divisor < 1 || ioctl( fd, TIOCSSERIAL, &sstruct ) < 0 ) { - return( JNI_TRUE ); + goto fail; } - return( JNI_FALSE ); + return( ( jboolean ) 0 ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeSetDivisor", + strerror( errno ) ); + return( ( jboolean ) 1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeSetDivisor", strerror( errno ) ); - return( JNI_TRUE ); + return( ( jboolean ) 1 ); #endif /* TIOCGSERIAL */ } @@ -1971,7 +1990,7 @@ accept: none perform: Find the Divisor used for custom speeds - return: Divisor + return: Divisor negative value on error. exceptions: Unsupported Comm Operation on systems not supporting TIOCGSERIAL comments: @@ -1990,10 +2009,14 @@ if ( ioctl( fd, TIOCGSERIAL, &sstruct ) < 0 ) { - return( ( jint ) -1 ); + goto fail; } return( ( jint ) sstruct.custom_divisor ); +fail: + throw_java_exception( env, IO_EXCEPTION, "nativeGetDivisor", + strerror( errno ) ); + return( ( jint ) -1 ); #else throw_java_exception( env, UNSUPPORTED_COMM_OPERATION, "nativeGetDivisor", strerror( errno ) ); @@ -2032,7 +2055,7 @@ /* Open and lock the port so nothing else changes the setting */ - if ( LOCK( filename, pid ) ) goto fail;; + if ( LOCK( filename, pid ) ) goto fail; fd = find_preopened_ports( filename ); if( !fd ) Index: src/SerialPort.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/Attic/SerialPort.java,v retrieving revision 1.3.2.9 diff -u -r1.3.2.9 SerialPort.java --- src/SerialPort.java 12 Oct 2004 08:59:28 -0000 1.3.2.9 +++ src/SerialPort.java 26 Jun 2005 16:59:30 -0000 @@ -103,13 +103,17 @@ public abstract String getUARTType() throws UnsupportedCommOperationException; public abstract boolean setBaudBase(int BaudBase) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getBaudBase() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setDivisor(int Divisor) - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract int getDivisor() - throws UnsupportedCommOperationException; + throws UnsupportedCommOperationException, + IOException; public abstract boolean setLowLatency() throws UnsupportedCommOperationException; public abstract boolean getLowLatency() cvs server: Diffing src/lfd cvs server: Diffing src/psmisc From uwe at kubosch.no Mon Jun 27 14:13:57 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Mon, 27 Jun 2005 22:13:57 +0200 Subject: [Rxtx] RXTX on FC4 Message-ID: <1119903238.2989.27.camel@BPC0276> Hi all! I just got RXTX to work on Fedora Core 4. The standard download did not work. I had to check the code out from CVS and build it, but then it worked flawlessly. Thanks for your good work. Now I wonder if I should contribute the compiled files so that others will have an easier time than me getting RXTX to work on FC4. What do I do? Who do I talk to? donV From taj at www.linux.org.uk Mon Jun 27 14:29:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 27 Jun 2005 21:29:46 +0100 (BST) Subject: [Rxtx] RXTX on FC4 In-Reply-To: <1119903238.2989.27.camel@BPC0276> References: <1119903238.2989.27.camel@BPC0276> Message-ID: On Mon, 27 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I just got RXTX to work on Fedora Core 4. > > The standard download did not work. > > I had to check the code out from CVS and build it, but then it worked > flawlessly. > > Thanks for your good work. > > Now I wonder if I should contribute the compiled files so that others > will have an easier time than me getting RXTX to work on FC4. What do I > do? Who do I talk to? > > The best thing to do with FC is to contibute an extras RPM. Debian does something like this with their .deb packaging. As rxtx is OS neutral, it is almost impossible to have everything on rxtx.org. If you do get a package in Fedora Extras, I can point a link there. The extra's mail list is here: https://www.redhat.com/mailman/listinfo/fedora-extras-list If it would help to have me release a 'stable' .tar.gz of the source for the RPM submittal process I can do that. It would also trigger upgrades in debian which would not be bad. -- Trent Jarvi tjarvi at qbang.org From slavelle at atcorp.com Mon Jun 27 16:23:20 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Mon, 27 Jun 2005 17:23:20 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: Message-ID: <42C07C58.1030608@atcorp.com> Hey Trent, I installed it and now I get IOExceptions instead of the other one. I'm not sure how those changes would have enabled setDivisor and setBaudBase to work though. Is it significant that this is a USB device emulating a serial port? ~ Shawn From taj at www.linux.org.uk Mon Jun 27 18:07:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 01:07:58 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: <42C07C58.1030608@atcorp.com> References: <42C07C58.1030608@atcorp.com> Message-ID: On Mon, 27 Jun 2005, Shawn Lavelle wrote: > Hey Trent, > I installed it and now I get IOExceptions instead of the other one. > I'm not sure how those changes would have enabled setDivisor and > setBaudBase to work though. Is it significant that this is a USB device > emulating a serial port? > The USB driver probably does not support this. With USB, the ioctl()'s appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through the linux drivers/usb tree and found to ioctl to support this in Linux 2.6.10. RXTX is not doing very much magic, the patch really only gets the serial struct instead of writing a structure with random values for baudbase and handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel level driver issue not a user space library issue. So if you wanted this to work, the usb serial driver would have to handle the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression after looking through the USB tree quickly. I hope that helps. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Jun 27 18:25:22 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 27 Jun 2005 20:25:22 -0400 Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) Message-ID: Hi All, I wrote: Jasmine: Is this working any better? And Jasmine says: Nope. An error occurred while launching/running the application. Title: addbk.JAddressBook.Main Vendor: DocJava, Inc. Category: Unexpected Error gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) I am using -source 1.3 and -target 1.3 for the compilation, however, we still seem to have this problem, which my machine (for some reason) does not have. Does anyone have any ideas about what might be the problem? Thanks! - DL From taj at www.linux.org.uk Mon Jun 27 19:04:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 02:04:37 +0100 (BST) Subject: [Rxtx] web start + RXTX = strange errors? (Jasmine Strong) In-Reply-To: References: Message-ID: On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I wrote: > Jasmine: Is this working any better? > > And Jasmine says: > Nope. > > An error occurred while launching/running the application. > > Title: addbk.JAddressBook.Main > Vendor: DocJava, Inc. > Category: Unexpected Error > > gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) > > > I am using -source 1.3 and -target 1.3 > for the compilation, however, we still seem to have this problem, > which my machine (for some reason) does not have. > Does anyone have any ideas about what might be the problem? > This has shown up in the past with jdk 1.5 compiled jars running on jre 1.4 machines. My guess is either jasmine has an old copy of rxtx with the problem on her machine that is being picked up on the classpath or you have not tried this with jre 1.4. The suggested -source/target fix should avoid the problem. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Mon Jun 27 21:23:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 04:23:55 +0100 (BST) Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: On Tue, 28 Jun 2005, Trent Jarvi wrote: > On Mon, 27 Jun 2005, Shawn Lavelle wrote: > > > Hey Trent, > > I installed it and now I get IOExceptions instead of the other one. > > I'm not sure how those changes would have enabled setDivisor and > > setBaudBase to work though. Is it significant that this is a USB device > > emulating a serial port? > > > > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > > RXTX is not doing very much magic, the patch really only gets the serial > struct instead of writing a structure with random values for baudbase and > handles errors cleaner. Supporting the TIOC*SERIAL ioctl is a kernel > level driver issue not a user space library issue. > > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. > > I hope that helps. > > > It may be possible that you can just modify translate_speed and get_java_baudrate in SerialImp.c to have the new high speds you are after. The defines are in /usr/include/termios.h. #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 You can see many of these are not handled. I dont think CommAPI handled more than 57600 or so. int get_java_baudrate( int native_speed ) { switch( native_speed ) { case B0: return 0; case B50: return 50; case B75: return 75; case B110: return 110; case B134: return 134; case B150: return 150; case B200: return 200; case B300: return 300; case B600: return 600; case B1200: return 1200; case B1800: return 1800; case B2400: return 2400; case B4800: return 4800; case B9600: return 9600; case B19200: return 19200; case B38400: return 38400; case B57600: return 57600; default: return -1; } } int translate_speed( JNIEnv *env, jint speed ) { LEAVE( "RXTXPort:translate_speed" ); switch( speed ) { case 0: return B0; case 50: return B50; case 75: return B75; case 110: return B110; case 134: return B134; case 150: return B150; case 200: return B200; case 300: return B300; case 600: return B600; case 1200: return B1200; case 1800: return B1800; case 2400: return B2400; case 4800: return B4800; case 9600: return B9600; case 19200: return B19200; case 38400: return B38400; #ifdef B57600 case 57600: return B57600; #endif /* B57600 */ #ifdef B115200 case 115200: return B115200; #endif /* B115200 */ #ifdef B230400 case 230400: return B230400; #endif /* B230400 */ #ifdef B460800 case 460800: return B460800; #endif /* B460800 */ #ifdef B14400 case 14400: return B14400; #endif /* B14400 */ #ifdef B28800 case 28800: return B28800; #endif /* B28800 */ #ifdef B128000 /* dima */ case 128000: return B128000; #endif /* dima */ #ifdef B256000 /* dima */ case 256000: return B256000; #endif /* dima */ } /* Handle custom speeds */ if( speed >= 0 ) return speed; else { LEAVE( "RXTXPort:translate_speed: Error condition" ); return -1; } } -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Jun 28 05:20:21 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 28 Jun 2005 07:20:21 -0400 Subject: [Rxtx] cross-compilation using Make for Mac Message-ID: Hi All, Please excuse the long post; Trent said: >" >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. " Here is what I have on the mac version: java -version java version "1.4.2_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4) Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) When I run: http://show.docjava.com:8086/book/cgij/code/jnlp/math.benchmarks.Dhry.jnlp I get: -- listing properties -- jnlpx.heapsize=NULL,NULL jnlpx.splashport=-1 java.runtime.name=Java(TM) 2 Runtime Environment, Stand... java.protocol.handler.pkgs=com.sun.javaws.net.protocol sun.boot.library.path=/System/Library/Frameworks/JavaVM.fra... java.vm.version=1.4.2-38 awt.nativeDoubleBuffering=true gopherProxySet=false http.auth.serializeRequests=true java.vm.vendor="Apple Computer, Inc." java.vendor.url=http://apple.com/ path.separator=: java.vm.name=Java HotSpot(TM) Client VM file.encoding.pkg=sun.io jnlpx.home=/Applications/Utilities/Java/Java Web... user.country=US sun.os.patch.level=unknown java.vm.specification.name=Java Virtual Machine Specification user.dir=/ java.runtime.version=1.4.2_05-141.4 java.awt.graphicsenv=apple.awt.CGraphicsEnvironment java.endorsed.dirs=/System/Library/Frameworks/JavaVM.fra... os.arch=ppc java.io.tmpdir=/tmp line.separator= java.vm.specification.vendor=Sun Microsystems Inc. jnlpx.remove=false os.name=Mac OS X sun.java2d.fontpath= java.library.path=/Applications/Utilities/Java/Java Web... java.specification.name=Java Platform API Specification java.class.version=48.0 jnlpx.deployment.user.home=/Users/lyon/Library/Caches/Java Web S... java.util.prefs.PreferencesFactory=java.util.prefs.MacOSXPreferencesFactory os.version=10.3.9 user.home=/Users/lyon user.timezone=America/New_York java.security.policy=file:/Applications/Utilities/Java/Jav... java.awt.printerjob=apple.awt.CPrinterJob trustProxy=true java.specification.version=1.4 file.encoding=MacRoman jnlpx.deployment.system.home=/Applications/Utilities/Java/J2SE 5.0... user.name=lyon java.class.path=/Applications/Utilities/Java/Java Web... java.vm.specification.version=1.0 sun.arch.data.model=32 java.home=/System/Library/Frameworks/JavaVM.fra... java.specification.vendor=Sun Microsystems Inc. user.language=en awt.toolkit=apple.awt.CToolkit java.vm.info=mixed mode java.version=1.4.2_05 java.ext.dirs=/Users/lyon/Library/Java/Extensions:/... sun.boot.class.path=/System/Library/Frameworks/JavaVM.fra... java.vendor=Apple Computer, Inc. file.separator=/ java.vendor.url.bug=http://developer.apple.com/java/ sun.cpu.endian=big sun.io.unicode.encoding=UnicodeBig mrj.version=141.3 jnlpx.jvm=/System/Library/Frameworks/JavaVM.fra... sun.cpu.isalist= sun.awt.exception.handler=apple.awt.CToolkit$EventQueueExceptio... javawebstart.version=javaws-1.4.2_05 800 mhz g4,878k ds/sec total time: 1184ms Result: 844594 dhrystone/sec. Load average for last 15 minutes:0.62 So, I feel pretty sure that I have tried this with 1.4. As to modifying the RXTX compilation, that I did not do...and I take your point. I have been using the binary distributions as is. Oops. I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Now when I do a make, I get: make gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known libtool: link: warning: undefined symbols not allowed in i386-pc-mingw32 shared libraries rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial-2.1-7pre20.* (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ln: `SerialImp.o': File exists make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 So, I do a make clean, then a make: .... (cd /home/lyon/current/java/serial/cvs/i386-pc-mingw32 && ln -s SerialImp.lo SerialImp.o) ar cru .libs/librxtxSerial.a /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o ar: /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.o: No such file or directory make: *** [i386-pc-mingw32/librxtxSerial.la] Error 1 In the i386 directory, there is a symbolic link left from something: ls -al SerialImp.o lrwxrwxrwx 1 lyon lyon 12 Jun 28 07:03 SerialImp.o -> SerialImp.lo However, the SerialImp.lo is not present (which is the cause of the error, I think). On the other hand, the file I am looking for is present in: i686-pc-linux-gnu Possibly the i386 generation is not clean (of course it is also likely that I am just asking dumb questions, being a newbie to the code and all.). Finally, will this make file regenerate the distro for the mac? I found some really old (from year 2001) files in: cvs/MACOSX_IDE/ForPackageMaker/Install/Library/Java/Extensions Which I could use for the distro...but I would prefer to do a clean, multi-platform build from make. Thanks! - Doug >On Mon, 27 Jun 2005, Dr. Douglas Lyon wrote: > >> Hi All, >> I wrote: >> Jasmine: Is this working any better? >> >> And Jasmine says: >> Nope. >> >> An error occurred while launching/running the application. >> >> Title: addbk.JAddressBook.Main >> Vendor: DocJava, Inc. >> Category: Unexpected Error >> >> gnu/io/CommPortOwnershipListener (Unsupported major.minor version 49.0) >> >> > > I am using -source 1.3 and -target 1.3 >> for the compilation, however, we still seem to have this problem, >> which my machine (for some reason) does not have. >> Does anyone have any ideas about what might be the problem? >> > >This has shown up in the past with jdk 1.5 compiled jars running on jre >1.4 machines. My guess is either jasmine has an old copy of rxtx with the >problem on her machine that is being picked up on the classpath or you >have not tried this with jre 1.4. > > >The suggested -source/target fix should avoid the problem. > >-- >Trent Jarvi >tjarvi at qbang.org From slavelle at atcorp.com Tue Jun 28 09:43:41 2005 From: slavelle at atcorp.com (Shawn Lavelle) Date: Tue, 28 Jun 2005 10:43:41 -0500 Subject: [Rxtx] [Patch] Linux Custom Baud Rates. In-Reply-To: References: <42C07C58.1030608@atcorp.com> Message-ID: <42C1702D.1070307@atcorp.com> > The USB driver probably does not support this. With USB, the ioctl()'s > appear to be defined in linux/drivers/usb/serial/*.c I grep'ed through > the linux drivers/usb tree and found to ioctl to support this in Linux > 2.6.10. > So if you wanted this to work, the usb serial driver would have to handle > the TIOCGSERIAL and TIOCSSERIAL ioctls. At least that is my impression > after looking through the USB tree quickly. There is ioctl stuff in the driver for the chip, but i haven't seen the TIOC*SERIAL entries. That might be why it continues to fail. I did get around the problem, though, by hacking the driver and just specifying the baud rate I need. Now everything works well. Thanks for all the assistance you've provided. ~ Shawn M. Lavelle From taj at www.linux.org.uk Tue Jun 28 12:42:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:42:29 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: gcc -I/home/lyon/current/java/serial/cvs -Ii386-pc-mingw32 -I. -I/usr/java/jdk1.5.0_02//include -I/usr/java/jdk1.5.0_02//include/./linux/ -ansi -D_BSD_SOURCE -D__need_timespec -c /home/lyon/current/java/serial/cvs/./src/SerialImp.c -DDLL_EXPORT -DPIC -o /home/lyon/current/java/serial/cvs/i386-pc-mingw32/SerialImp.lo /home/lyon/current/java/serial/cvs/src/SerialImp.c: In function `Java_gnu_io_RXTXPort_Initialize': /home/lyon/current/java/serial/cvs/src/SerialImp.c:251: storage size of `old_action' isn't known /home/lyon/current/java/serial/cvs/src/SerialImp.c:256: storage size of `new_action' isn't known Add a compiler flag -DWIN32 The code above should not be compiling on w32 as it is #if !defined(WIN32) You can look at the bottom of Makefile.in to see the w32 compile flags. Search for "WIN32 CrossCompiling from here down" If its still not working, I can set you up with the Bob account. Just email me off the list. W32 compiling is a bit complicated. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Tue Jun 28 12:52:50 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 28 Jun 2005 19:52:50 +0100 (BST) Subject: [Rxtx] cross-compilation using Make for Mac In-Reply-To: References: Message-ID: I went into the Makefile and altered the javac flag: JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O -source 1.3 -ta rget 1.3 Since this is auto-generated, I would think that the better thing to do would be to alter configure. Nods. I did change configure but right now it is only in the baudbase/divisor patch I posted. I'm going to add several extension baud rates that can be supported by normal API calls and commit that today as a followup to my comments yesterday on baudrates. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Wed Jun 29 01:52:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 08:52:10 +0100 (BST) Subject: [Rxtx] [PATCH] More baud rate fixes Message-ID: I went through the native baudrate conversion from Java and added several. This patch is against CVS 2.1 head. I think thats it for baud rate fixes unless someone see something. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- A non-text attachment was scrubbed... Name: baud_base_and_divisor_plus_odd_baudrates.diff.gz Type: application/x-gzip Size: 3291 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050629/4c1ef1c2/baud_base_and_divisor_plus_odd_baudrates.diff-0008.gz From lyon at docjava.com Wed Jun 29 10:33:45 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 29 Jun 2005 12:33:45 -0400 Subject: [Rxtx] java.comm dependencies Message-ID: Hi All, During a build of the rxtx code, I have left the javax.comm out of the system (on purpose). However, I get an error, at run time: CommPortIdentifier:static initialization() apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoClassDefFoundError: javax/comm/CommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver I am thinking that there is something in the gnu.io.CommPortIdentifier that seeks to load the javax.comm.CommDriver. It was my understanding that we could write code without reference to the javax.comm.CommDriver and that we could work in the gnu namespace. Is this true? Thanks! - Doug From taj at www.linux.org.uk Wed Jun 29 11:16:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 29 Jun 2005 18:16:08 +0100 (BST) Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > During a build of the rxtx code, I have left the > javax.comm out of the system (on purpose). > However, I get an error, at run time: > > CommPortIdentifier:static initialization() > apple.awt.EventQueueExceptionHandler Caught Throwable : > java.lang.NoClassDefFoundError: javax/comm/CommDriver > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > that seeks to load the javax.comm.CommDriver. > > It was my understanding that we could write code without reference > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > Is this true? > Yes. People use 2.1 without javax all the time. There should be no reference to javax at all in rxtx 2.1. You may check your code. I just did a grep through 2.1 and there is nothing. You may look at the classes you are using. If you find javax.comm in your code, replace it with gnu.io and that should be all you need to do. -- Trent Jarvi tjarvi at qbang.org From jayant28k at gmail.com Wed Jun 29 21:49:28 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Thu, 30 Jun 2005 09:19:28 +0530 Subject: [Rxtx] java.comm dependencies In-Reply-To: References: Message-ID: <6a6a02310506292049778c452f@mail.gmail.com> Trent, I think best idea is to have wiki for rxtx code. So as the traffic is increasing with time. "RXTX" seems to be more popular in embbeded system. Sun Microsystems will always apperciate your efforts on parallel and serial ports commincation based application in IT Industry. Thanks for your help on this forum as "ONE MAN ARMY" ;-) Cheers, Jayant On 6/29/05, Trent Jarvi wrote: > On Wed, 29 Jun 2005, Dr. Douglas Lyon wrote: > > > Hi All, > > During a build of the rxtx code, I have left the > > javax.comm out of the system (on purpose). > > However, I get an error, at run time: > > > > CommPortIdentifier:static initialization() > > apple.awt.EventQueueExceptionHandler Caught Throwable : > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > java.lang.NoClassDefFoundError: javax/comm/CommDriver > > > > > > I am thinking that there is something in the gnu.io.CommPortIdentifier > > that seeks to load the javax.comm.CommDriver. > > > > It was my understanding that we could write code without reference > > to the javax.comm.CommDriver and that we could work in the gnu namespace. > > > > Is this true? > > > > Yes. People use 2.1 without javax all the time. > > There should be no reference to javax at all in rxtx 2.1. You may check > your code. I just did a grep through 2.1 and there is nothing. You may > look at the classes you are using. > > If you find javax.comm in your code, replace it with gnu.io and that > should be all you need to do. > > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at mail.electronpusher.org > http://www.electronpusher.org/mailman/listinfo/rxtx > From uwe at kubosch.no Sat Jun 25 02:50:24 2005 From: uwe at kubosch.no (Uwe Kubosch) Date: Sat, 25 Jun 2005 10:50:24 +0200 Subject: [Rxtx] RXTX in FC3/FC4 Message-ID: <1119689424.12606.14.camel@BPC0276> Hi all! I am trying to get RXTX to work on Fedora Core, version 3 or 4. I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext directory. I have edited the jre/lib/javax.comm.properties according to the docs. I have tried this with both rxtx 2.0 and 2.1. I have tried on two different machines. I have tried with java 1.4.2 and java 1.5.0, both from Sun. I always get a signall 11 from the native libraries when they are loaded. Is this a common problem? Any help is greatly appreciated. Below is the start of the error message. More can be supplied on demand. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x65015A Function=(null)+0x65015A Library=/lib/ld-linux.so.2 NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) - locked <0xed46f628> (a java.util.Vector) - locked <0xed471708> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0xed46ebc0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.InitializeDriver(CommPortIdentifier.java:213) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:248) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:351) at com.jpeterson.x10.module.CM11A.allocate(CM11A.java:1160) at net.sourceforge.cruisecontrol.publishers.X10Publisher.send(X10Publisher.java:182) at net.sourceforge.cruisecontrol.publishers.X10Publisher.turnOff(X10Publisher.java:171) at net.sourceforge.cruisecontrol.publishers.X10Publisher.handleBuild(X10Publisher.java:148) at net.sourceforge.cruisecontrol.publishers.X10Publisher.publish(X10Publisher.java:141) at net.sourceforge.cruisecontrol.Project.publish(Project.java:679) at net.sourceforge.cruisecontrol.Project.build(Project.java:227) at net.sourceforge.cruisecontrol.Project.execute(Project.java:153) at net.sourceforge.cruisecontrol.ProjectWrapper.run(ProjectWrapper.java:66) at java.lang.Thread.run(Thread.java:534) From chris_jh at blueyonder.co.uk Tue Jun 28 05:37:10 2005 From: chris_jh at blueyonder.co.uk (Christopher Harris) Date: Tue, 28 Jun 2005 12:37:10 +0100 Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError Message-ID: <42C13666.9030108@blueyonder.co.uk> Hi I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 32bit) The serial ports work fine with no issues, but when i try to use the parallel port i get this message Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize at gnu.io.LPRPort.Initialize(Native Method) at gnu.io.LPRPort.(LPRPort.java:66) at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) I am trying to print a line out to port "/dev/lp0" At first i thought it could not find the librxtxParallel.so file, but when i renamed it i got a different saying it could not find the library. I have tried to run as root no difference. It is really weird, i get no compile errors and the serial ports work fine. I changed the LPRPort.java and commented out the Initialize call method. And just get the same error but for the method open. It is as though it can't see the methods, and yet it can see the library. I did have a bit of check of the JNI implementation in rxtx but could not spot anything. Yours Thankfully Christopher Harris From lyon at docjava.com Thu Jun 30 02:28:09 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 04:28:09 -0400 Subject: [Rxtx] tools Message-ID: Hi All, I have been thinking about automatic cross-platform native method development of Java/C programs. It appears that different binary tools are needed to target different platforms. Configuration seems a bit painful. Is there something better available than make? Is ANT any good at this? Has anyone tried: http://jnipp.sourceforge.net/ Thanks! - Doug From lyon at docjava.com Thu Jun 30 04:11:17 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 30 Jun 2005 06:11:17 -0400 Subject: [Rxtx] javax.comm Message-ID: Hi All, When I load my jar files on a linux box, all is well. However, when I load them on a mac, I get: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver The jar files for the mac are different from the jar files for linux, because recompilation of the native code for the mac has not been easy, for me. As a result, the RXTX jars are tending toward specific versions and platforms. Probably, this is not an ideal situation, but, I suspect, it is common. I have an idea that we could create a single JNLP distro site that we can make reference to that would enable a uniform repository of synchronized signed native methods and jars for RXTX. For example, the one-wire Maxim folks have a real-nice approach where their stuff makes reference to another JNLP file that contains all the stuff we need to make RXTX work. Check it out at: http://www.maxim-ic.com/products/ibutton/software/1wire/OneWireViewer.cfm However, even they have problems on an unconfigured machine: Specified adapter name "DS9097U" is not known * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cannot load default adapter. Please check that the adapter is connected and that no other application is using the port. If you have checked the adapter, the default port might not be selected. Either set the value of the TMEX default using the utility provided with the TMEX Runtime, or create a new file in the /lib folder called onewireviewer.properties with two lines, similar to the following: #native win32 drivers adapter.name={DS9097U} adapter.port=COM1 #or javax.comm drivers adapter.name=DS9097U adapter.port=COM1 The full path to this file should be: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/onewireviewer.properties ---- Wow, that is a show stopper! Configuration is something that we really need to think about as an automatic thing, particularly for web start users. You can't ask a person who wants to run an application to figure out how to alter a properties file. If you know you need one, then get permission and make one...automatically. That makes a lot of sense, to me. Basically, we need an installer. At the very least, all the pre-built binaries and jars needed for the RXTX package on several platforms should be available from a single place. One this happens, we can make a JNLP file that is platform specific, but can give us a level of indirection. Is this something that has been done already? Thanks! - Doug From taj at www.linux.org.uk Thu Jun 30 08:10:22 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 15:10:22 +0100 (BST) Subject: [Rxtx] tools In-Reply-To: References: Message-ID: On Thu, 30 Jun 2005, Dr. Douglas Lyon wrote: > Hi All, > I have been thinking about automatic cross-platform > native method development of Java/C programs. > > It appears that different binary tools are needed to target different > platforms. Configuration seems a bit painful. > > Is there something better available than make? > > Is ANT any good at this? I'm far from an Ant expert but have used it for other projects. The main problem I see with ant is there is no mainstream support for platform neutral neutral library creation as far as I can tell. I think ant is a fine replacement for make but I've not seen a suitable replacement for autoconf. At that point, make is as good as anything. It should be possible to create a ant build.xml that works on say Solaris, Linux, Windows and Mac OS X. The problem is when you are trying to build a library for embeded ARM from Mac OS X. > Has anyone tried: > http://jnipp.sourceforge.net/ -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:22:02 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:22:02 +0100 (BST) Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <1119689424.12606.14.camel@BPC0276> References: <1119689424.12606.14.camel@BPC0276> Message-ID: On Sat, 25 Jun 2005, Uwe Kubosch wrote: > Hi all! > > I am trying to get RXTX to work on Fedora Core, version 3 or 4. > > I have copied the *.so files to /usr/java/j2sdk1.4.2_04/jre/lib/i386 > directory and the RXTXcomm.jar to /usr/java/j2sdk1.4.2_04/jre/lib/ext > directory. > > I have edited the jre/lib/javax.comm.properties according to the docs. > > I have tried this with both rxtx 2.0 and 2.1. > > I have tried on two different machines. > > I have tried with java 1.4.2 and java 1.5.0, both from Sun. > > I always get a signall 11 from the native libraries when they are > loaded. Is this a common problem? Any help is greatly appreciated. > Below is the start of the error message. More can be supplied on > demand. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x65015A > Function=(null)+0x65015A > Library=/lib/ld-linux.so.2 > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) If you compile rxtx from source, this will probably go away. I'm not sure what the exact cause is but it looks like the binaries are not suitable for FC3/4. The ABI may have changed since those had been compiled. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Thu Jun 30 14:26:56 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 30 Jun 2005 21:26:56 +0100 (BST) Subject: [Rxtx] PARALLEL PORT java.lang.UnsatisfiedLinkError In-Reply-To: <42C13666.9030108@blueyonder.co.uk> References: <42C13666.9030108@blueyonder.co.uk> Message-ID: tOn Tue, 28 Jun 2005, Christopher Harris wrote: > Hi > > I am using java 1.5 (32bit) and rxtx-2.0-7pre2 on linux (Mandrake 10.2 > 32bit) > > The serial ports work fine with no issues, but when i try to use the > parallel port i get this message > > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: Initialize > at gnu.io.LPRPort.Initialize(Native Method) > at gnu.io.LPRPort.(LPRPort.java:66) > at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java:830) > at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:547) > > > I am trying to print a line out to port "/dev/lp0" > > At first i thought it could not find the librxtxParallel.so file, but > when i renamed it i got a different saying it could not find the library. > > I have tried to run as root no difference. > > It is really weird, i get no compile errors and the serial ports work fine. > > I changed the LPRPort.java and commented out the Initialize call method. > And just get the same error but for the method open. > > It is as though it can't see the methods, and yet it can see the library. > I did have a bit of check of the JNI implementation in rxtx but could > not spot anything. > > > You can check if the symbols are in the shared library: nm librxtxSerial.so |grep Initialize If the symbols are not there, there was a build error. Watch very close for build errors while compiling from source. I suspect something isnt behaving right. -- Trent Jarvi tjarvi at qbang.org From allen at adbyrne.us Thu Jun 30 06:55:58 2005 From: allen at adbyrne.us (Allen Byrne) Date: Thu, 30 Jun 2005 07:55:58 -0500 Subject: [Rxtx] RXTX in FC3/FC4 In-Reply-To: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> References: <20050630053101.BEB0C29D5F2@mail.electronpusher.org> Message-ID: <200506300755.59159.allen@adbyrne.us> On Thursday 30 June 2005 00:31, rxtx-request at mail.electronpusher.org wrote: > >Message: 8 >Date: Sat, 25 Jun 2005 10:50:24 +0200 >From: Uwe Kubosch >Subject: [Rxtx] RXTX in FC3/FC4 >To: rxtx at mail.electronpusher.org >Message-ID: <1119689424.12606.14.camel at BPC0276> >Content-Type: text/plain > >Hi all! > >I am trying to get RXTX to work on Fedora Core, version 3 or 4. > >I have tried this with both rxtx 2.0 and 2.1. > >I have tried on two different machines. > >I have tried with java 1.4.2 and java 1.5.0, both from Sun. > >I always get a signall 11 from the native libraries when they are >loaded. ?Is this a common problem? ?Any help is greatly appreciated. >Below is the start of the error message. ?More can be supplied on >demand. > >An unexpected exception has been detected in native code outside the VM. >Unexpected Signal : 11 occurred at PC=0x65015A >Function=(null)+0x65015A >Library=/lib/ld-linux.so.2 > I had thi same problem on SUSE9.3 and java 1.5.0. After searching through the archives, I found a patch that required adding a sleep(1000) command in two functions of SerialIO.java. This only was for rxtx2.1, I had no trouble with rxtx2.0. Note, also I had to add the "|1.5*" sequence to the configure.in file to get good *.so libs. Again 2.0 was fine. -- Allen Byrne adbyrne at ieee.org http://modelrr.adbyrne.us From taj at www.linux.org.uk Fri Jun 3 01:57:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 08:57:29 +0100 (BST) Subject: [Rxtx] test Message-ID: ignor this. -- Trent Jarvi tjarvi at qbang.org From taj at www.linux.org.uk Fri Jun 3 09:57:53 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 3 Jun 2005 16:57:53 +0100 (BST) Subject: [Rxtx] Test - ignore Message-ID: The servers are being moved around. I'll follow up with another email when we get them working. -- Trent Jarvi tjarvi at qbang.org From jasmine at electronpusher.org Fri Jun 3 10:12:21 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 17:12:21 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: References: Message-ID: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > > The servers are being moved around. I'll follow up with another email > when we get them working. This is testing replies. -Jasmine, mild mannered janitor. From jasmine at electronpusher.org Fri Jun 3 11:02:09 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:02:09 +0100 Subject: [Rxtx] Testing again Message-ID: <1673187c88ba972b786909815e58ec26@electronpusher.org> Let's see what this does. -J., gruff janitor From jasmine at electronpusher.org Fri Jun 3 11:05:10 2005 From: jasmine at electronpusher.org (Jasmine Strong) Date: Fri, 3 Jun 2005 18:05:10 +0100 Subject: [Rxtx] Test - ignore In-Reply-To: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> References: <2ce5bee7177f3110d17346579dd3c2ee@electronpusher.org> Message-ID: On 3 Jun 2005, at 17:12, Jasmine Strong wrote: > > On 3 Jun 2005, at 16:57, Trent Jarvi wrote: > >> >> The servers are being moved around. I'll follow up with another email >> when we get them working. > > This is testing replies. replies to replies? -J. From jon.nall at gmail.com Mon Jun 6 09:13:58 2005 From: jon.nall at gmail.com (Jon Nall) Date: Mon, 6 Jun 2005 10:13:58 -0500 Subject: [Rxtx] StackOverflowError Message-ID: I have a fairly small application that is communicating to a microcontroller programmer at 115.2k. I have a test where I try and dump the memory of the microcontroller (whose size is 8k and change). Things are going smoothly and the data looks good. Then after reading out ~6.5k of data, I get a StackOverflowError. The stack trace looks like: CommInterface.serialEvent(): 324 // this is my code RXTXPort.sendEvent(): 732 RXTXPort.eventLoop() [Native] MonitorThread.run(): 1531 I am running on windows and using rxtx-2.1-CVS-20050120. When I increased the stack size to 512k, I could read the entire chip without issue. But that doesn't seem like the right thing to do without root causing what's happening. My code doesn't include any recursion and the stack trace looks terribly short, so I'm a bit confused as to why I'm getting a StackOverflowError. CommInterface.serialEvent() does little more than grab the available bytes, enter a synchronized block, stick them in a common data area for the main thread to use and leave the synchronization block. I guess my question is: are there any known issues with the default stack size when using the latest rxtx on windows? thanks, nall. From taj at www.linux.org.uk Mon Jun 6 09:27:34 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 16:27:34 +0100 (BST) Subject: [Rxtx] StackOverflowError In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, Jon Nall wrote: > I have a fairly small application that is communicating to a > microcontroller programmer at 115.2k. I have a test where I try and > dump the memory of the microcontroller (whose size is 8k and change). > Things are going smoothly and the data looks good. Then after reading > out ~6.5k of data, I get a StackOverflowError. The stack trace looks > like: > > CommInterface.serialEvent(): 324 // this is my code > RXTXPort.sendEvent(): 732 > RXTXPort.eventLoop() [Native] > MonitorThread.run(): 1531 > > I am running on windows and using rxtx-2.1-CVS-20050120. When I > increased the stack size to 512k, I could read the entire chip without > issue. But that doesn't seem like the right thing to do without root > causing what's happening. My code doesn't include any recursion and > the stack trace looks terribly short, so I'm a bit confused as to why > I'm getting a StackOverflowError. > > CommInterface.serialEvent() does little more than grab the available > bytes, enter a synchronized block, stick them in a common data area > for the main thread to use and leave the synchronization block. > > I guess my question is: are there any known issues with the default > stack size when using the latest rxtx on windows? > This is the first I've heard of the problem. It is strange as you mention lookin at the stack trace. That cant be taking up too much space. If you just toss the data instead of trying to put it in your work area, does it persist? -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Mon Jun 6 10:09:39 2005 From: lengyel at gmail.com (FL) Date: Mon, 6 Jun 2005 12:09:39 -0400 Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on which the jdk1.5.0_03 is installed. I found that the INSTALL documentation seems to be in error. It states that javacomm20-x86.tar.Z (the Java Communications API for Solaris/x86) must be used, in fact this choice led to the following test with theBlackBox sample program in the commapi: root at creature:~/commapi/samples/BlackBox# java -classpath .:$CLASSPARG BlackBox -p /dev/ttyS0 Port /dev/ttyS0 not found! No serial ports found! Moreover, the installation of comm.jar in $JAVA_HOME/jre/lib/ext seemed to cause Eclipse 3.0.1 to exit due to a fatal error; it was necessary to upgrade to the Eclipse stable build version 3.1M7 to avoid this. However, I found that using the Solaris/Sparc version of commapi worked on my system. I have documented this on: http://research.gc.cuny.edu/index.php/Serial_I/O_in_Java_JDK_1.5_03 FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050606/b28fb9a7/attachment-0009.html From taj at www.linux.org.uk Mon Jun 6 10:30:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 6 Jun 2005 17:30:27 +0100 (BST) Subject: [Rxtx] Fwd: Installing rxtx on a Debian Linux 3.1 x86 system In-Reply-To: References: Message-ID: On Mon, 6 Jun 2005, FL wrote: > I've installed rxtx-2.0.7pre2 source on a Debian Linux 3.1 x86 system,on > which the jdk1.5.0_03 is installed. I found that the INSTALL documentation > seems to be in error. It states that javacomm20-x86.tar.Z (the Java > Communications API for Solaris/x86) must be used, in fact this choice led to > the follo